3 minutes
Modules Python populaires
Voici une liste de modules Python populaires trouvée sur le site https://pymotw.com/3/index.html. L’avantage de ce site est qu’il fournit des exemples clairs pour les utiliser.
Text
- string: Text Constants and Templates
- textwrap: Formatting Text Paragraphs
- re: Regular Expressions
- difflib: Compare Sequences
Data Structures
- enum: Enumeration Type
- collections: Container Data Types
- array: Sequence of Fixed-type Data
- heapq: Heap Sort Algorithm
- bisect: Maintain Lists in Sorted Order
- queue: Thread-Safe FIFO Implementation
- struct: Binary Data Structures
- weakref: Impermanent References to Objects
- copy: Duplicate Objects
- pprint: Pretty-Print Data Structures
- forwardable: Delegate methods creation for composition in OOP (https://pypi.org/project/forwardable/)
Algorithms
- functools: Tools for Manipulating Functions
- itertools: Iterator Functions
- operator: Functional Interface to Built-in Operators
- contextlib: Context Manager Utilities
Dates and Times
- time: Clock Time
- datetime: Date and Time Value Manipulation
- calendar: Work with Dates
Mathematics
- decimal: Fixed and Floating Point Math
- fractions: Rational Numbers
- random: Pseudorandom Number Generators
- math: Mathematical Functions
- statistics: Statistical Calculations
The File System
- os.path: Platform-independent Manipulation of Filenames
- pathlib: Filesystem Paths as Objects
- glob: Filename Pattern Matching
- fnmatch: Unix-style Glob Pattern Matching
- linecache: Read Text Files Efficiently
- tempfile: Temporary File System Objects
- shutil: High-level File Operations
- filecmp: Compare Files
- mmap: Memory-map Files
- codecs: String Encoding and Decoding
- io: Text, Binary, and Raw Stream I/O Tools
Data Persistence and Exchange
- pickle: Object Serialization
- shelve: Persistent Storage of Objects
- dbm: Unix Key-Value Databases
- sqlite3: Embedded Relational Database
- xml.etree.ElementTree: XML Manipulation API
- csv: Comma-separated Value Files
Data Compression and Archiving
- zlib: GNU zlib Compression
- gzip: Read and Write GNU zip Files
- bz2: bzip2 Compression
- tarfile: Tar Archive Access
- zipfile: ZIP Archive Access
Cryptography
- hashlib: Cryptographic Hashing
- hmac: Cryptographic Message Signing and Verification
Concurrency with Processes, Threads, and Coroutines
- subprocess: Spawning Additional Processes
- signal: Asynchronous System Events
- threading: Manage Concurrent Operations Within a Process
- multiprocessing: Manage Processes Like Threads
- asyncio: Asynchronous I/O, event loop, and concurrency tools
- concurrent.futures: Manage Pools of Concurrent Tasks
Networking
- ipaddress: Internet Addresses
- socket: Network Communication
- selectors: I/O Multiplexing Abstractions
- select: Wait for I/O Efficiently
- socketserver: Creating Network Servers
The Internet
- urllib.parse: Split URLs into Components
- urllib.request: Network Resource Access
- urllib.robotparser: Internet Spider Access Control
- base64: Encode Binary Data with ASCII
- http.server: Base Classes for Implementing Web Servers
- http.cookies: HTTP Cookies
- webbrowser: Displays web pages
- uuid: Universally Unique Identifiers
- json: JavaScript Object Notation
- xmlrpc.client: Client Library for XML-RPC
- xmlrpc.server: An XML-RPC server
- smtplib: Simple Mail Transfer Protocol Client
- smtpd: Sample Mail Servers
- mailbox: Manipulate Email Archives
- imaplib: IMAP4 Client Library
Application Building Blocks
- argparse: Command-Line Option and Argument Parsing
- getopt: Command Line Option Parsing
- readline: The GNU readline Library
- getpass: Secure Password Prompt
- cmd: Line-oriented Command Processors
- shlex: Parse Shell-style Syntaxes
- configparser: Work with Configuration Files
- logging: Report Status, Error, and Informational Messages
- fileinput: Command-Line Filter Framework
- atexit: Program Shutdown Callbacks
- sched: Timed Event Scheduler
Internationalization and Localization
- gettext: Message Catalogs
- locale: Cultural Localization API
Developer Tools
- pydoc: Online Help for Modules
- doctest: Testing Through Documentation
- unittest: Automated Testing Framework
- trace: Follow Program Flow
- traceback: Exceptions and Stack Traces
- cgitb: Detailed Traceback Reports
- pdb: Interactive Debugger
- profile and pstats: Performance Analysis
- timeit: Time the execution of small bits of Python code.
- tabnanny: Indentation validator
- compileall: Byte-compile Source Files
- pyclbr: Class Browser
- venv: Create Virtual Environments
- ensurepip: Install the Python Package Installer
Runtime Features
- site: Site-wide Configuration
- sys: System-specific Configuration
- os: Portable access to operating system specific features
- platform: System Version Information
- resource: System Resource Management
- gc: Garbage Collector
- sysconfig: Interpreter Compile-time Configuration
Language Tools
- warnings: Non-fatal Alerts
- abc: Abstract Base Classes
- dis: Python Bytecode Disassembler
- inspect: Inspect Live Objects
Modules and Packages
- importlib: Python’s Import Mechanism
- pkgutil: Package Utilities
- zipimport: Load Python Code from ZIP Archives
Unix-specific Services
- pwd: Unix Password Database
- grp: Unix Group Database