Python Practices
A curated collection of python practices for various topics
These may not be best practices, so you can contribute best one for each topics.
Issues and PRs are very welcome.
Table of Contents
This covers following topics with explanations and sample source codes.
- Basic
- Data Structure
- Standard Library
- Meta Programming
- Configuration
- Design Patterns
- Testing
- Regex
- Networking
- Database
- Data Handling
- Data Processing
- Concurrency
- API Programming
- Cryptography
- Functional Programming
- CLI
- C Extensions
- Debugging
- Profiling
- Easter Egg
Topics
Basic
- arguments (including
*args and **kwargs)
- builtin functions
- class
- comma
- comprehension
- decorator
- documentation
- exceptions handling
- file/dir handling
- functions
- import
- interface
- iterator and generator
- lambda
- logging
- map, filter and reduce
- method
- oop
- string formatting
- string operations
- type hinting
- underscore
Data Structure
- list
- tuple
- set
- dict
- fronzenset
- string
- stack
- queue
- linked list
- heap
- tree
- graph
Standard Library
- abc
- array
- collections
- ctypes
- datetime
- decimals
- functools
- future
- itertools
- math
- os
- pickle
- queue
- random
Meta Programming
Configuration
- 4 ways to manage the configuration
Design Patterns
- singleton
- factory
- adapter
- observer
Testing
- unittest
- pytest
- doctest
- coverage
Regex
Networking
- http
- tcp
- udp
- smtp
- ftp
- socket
Database
- sqlite3
- mysql
- postgresql
- redis
- mongodb
- orm
Data Handling
- json
- xml
- base64
- proto buffer
Data Processing
Concurrency
- multiprocessing
- multithreading
- asyncio
- celery
API Programming
Cryptography
Functional Programming
CLI
C Extensions
Debugging
Profiling
Easter Egg