The text
String: general string operation
Re: regular expression operation
Difflib: Difference calculation tool
Textwrap: Text fill
Unicodedata: Unicode character database
Stringprep: Internet string preparation tool
Readline: the GNU line-by-line interface
Rlcompleter: GNU’s implementation of reading by line
Struct: Parsing bytes into packaged binary data
Codecs: codecs for registry and base classes
The data type
Datetime: Datetime-based tools
Calendar: Generic month function
Collections: Container data types
Collections. ABC: Container virtual base class
Heapq: Heap queue algorithm
Bisect: Array binary algorithm
Array: efficient array of values
Weakref: weak reference
Types: Dynamic creation and naming of built-in types
Copy: shallow copy and deep copy
Reprlib: Implementation of alternate repr()
mathematics
Numbers: Virtual base class for numbers
Math: Math function
Cmath: Mathematical function of complex numbers
Decimal: Fixed-point and floating-point calculations
Fractions: the fractions are rational
Random: generates a pseudo-random number
Functional programming
Itertools: Generates iterators for efficient loops
Functools: Higher-order functions and operations on objects that can be called
Operator: Standard operation on a function
Files and Directories
Os. path: common path name control
Fileinput: Traverses rows from a multi-input stream
Stat: Interprets the result of stat()
Filecmp: compares files and directories
Tempfile: Generates temporary files and directories
Glob: An extension of the UNIx-style pathname format
Fnmatch: Matches unix-style path names
Linecache: Random storage of lines of text
Shutil: Advanced file operations
Macpath: MacOS 9 path control function
persistence
Pickle: Serialization of Python objects
Copyreg: Register machine support function for pickle
Shelve: Python object persistence
Marshal: Internal Python object serialization
DBM: Unix database interface
Sqlite3: API2.0 for SQLite databases
The compression
Zlib: GZIP-compatible compression
Gzip: Support for Gzip files
Bz2: Support for bzip2 compression
Lzma: Compression using lZMA algorithm
Zipfile: Operates the ZIP archive
Tarfile: Reads and writes tar files
encryption
Hashlib: Security hash and message digest
Hmac: Key hash for message authentication
Operating system tools
OS: Multifaceted operating system interface
IO: Stream core tool
Time: Time query and conversion
Argparser: A parser for command-line options, arguments, and subcommands
Optparser: Command line option parser
Getopt: C-style command-line options parser
Logging: Python logging tool
Logging. config: log configuration
Handlers: log handlers
Getpass: simple password input
Curses: Terminal processing of character display
Textpad: The text input field of the Curses program
Curses. ASCII: ASCII character set tool
Curses. Panel: Curses stack extension
Platform: Access authentication data of the underlying platform
Errno: indicates a standard error flag
Ctypes: Python external function library
concurrent
Threading: Thread-based parallelism
Multiprocessing: process-based parallelism
Concurrent: Sends packets concurrently
Concurrent. futures: Starts parallel tasks
Subprocess: manages subprocesses
Sched: event scheduling
Queue: indicates the synchronization queue
Select: waits for I/OS to complete
Dummy_threading: Replacement for the threading module (when _thread is not available)
_thread: The underlying thread API (threading based on it)
_dummy_thread: Replacement of the _thread module (when _thread is not available)
Interprocess communication
Socket: indicates the underlying network interface
SSL: TLS/SSL filler for the socket object
Asyncore: Asynchronous socket processor
Asynchat: Asynchronous socket command/response processor
Signal: asynchronous transaction signal processor
Mmap: Memory mapped file support
The Internet
Email: Mail and MIME processing package
Json: JSON encoding and decoding
Mailcap: MailCap file processing
Mailbox: controls the mailbox in multiple formats
Mimetypes: File names are mapped to MIME types
Base64: RFC3548: Base16, Base32, and Base64 encoding
Binhex: Binhex4 file encoding and decoding
Binascii: conversion between binary code and ASCII code
Quopri: Encoding and decoding of mimequoted-printable data
Uu: encoding and decoding of uuencode files
Internet Protocol and Support
Webbrowser: Simple Web browser controller
Cgi: CGI support
Cgitb: CGI script backtrace manager
Wsgiref: WSGI tool and reference implementation
Urllib: URL processing module
Urllib. request: Opens the extension library for URL connections
Urllib. response: Response class of the urllib module
Urllib.parse: Parses urls into components
Urllib. error: Exception class raised by urllib.request
Urllib. robotParser: a parser for robots.txt
HTTP: INDICATES the HTTP module
Http. client: indicates the HTTP client
Ftplib: indicates the FTP client
Poplib: POP protocol client
Imaplib: indicates the IMAP4 client
Nntplib: indicates the NNTP client
Smtplib: SMTP client
SMTPD: SMTP server
Telnetlib: Telnet client
Uuid: uUID object of RFC4122
Socketserver: Network server framework
Http. server: indicates the HTTP server
Http. cookies: HTTPCookie state manager
Http. cookiejar: HTTP client Cookie handling
XMLRPC: XML-RPC server and client modules
XMLRPC. Client: xmL-RPC client access
XMLRPC. Server: XmL-RPC server base
Ipaddress: indicates an IPv4 / IPv6 control library
multimedia
Audioop: Processes raw audio data
Aifc: Reads and writes AIFF and AIFC files
Sunau: Reads and writes Sun AU files
Wave: Reads and writes WAV files
Chunk: Reads IFF large files
Colorsys: conversion between color systems
Imghdr: Specifies the image type
SNDHDR: Specifies the sound file type
Ossaudiodev: Access osS-compatible audio devices
internationalization
Gettext: Internationalization services in multiple languages
Locale: international service
Programming framework
Turtle: Turtle graphics library
CMD: Line-based command interpreter support
Shlex: Simple dictionary analysis
Tk graphical user interface
Tkinter: Tcl/Tk interface
Tkinter. TTK: Tk theme control
Tkinter. Tix: Tk extension control
Tkinter. scrolledText: scroll text control
The development tools
Pydoc: Document generator and online help system
Doctest: Interactive Python sample
Unittest: unittest framework
Unittest. mock: Mock object libraries
Test: Python regression test package
Test. support: Python test tool suite
Venv: Virtual environment construction
debugging
BDB: Debugging framework
Faulthandler: Python backtrace library
PDB: Python debugger
Timeit: Small code execution time measurement
Trace: Python execution status tracing
The runtime
Sys: system related parameters and functions
Sysconfig: Access Python configuration information
Builtins: Built-in object
Main: Top-level scripting environment
Warnings: warning control
Contextlib: context tool for the with state
ABC: virtual base class
Atexit: indicates the exit processor
Traceback: Prints or reads a backward trace of the stack
Future: defines the future state
Gc: Garbage collection interface
Inspect: Inspects live objects
Site: site-specific configuration hooks
Fpectl: Floating point exception control
Distutils: Generate and install Python modules
The interpreter
Code: base class interpreter
Codeop: Compile Python code
The import module
Imp: Access the inside of the import module
Zipimport: Imports modules from the ZIP archive
Pkgutil: Package extension tool
Modulefinder: Finds modules through scripts
Runpy: Locates and executes Python modules
Importlib: an implementation of import
The Python language
Parser: Accesses the Python parse tree
Ast: Abstract syntax tree
Symtable: Access the compiler symbol table
Symbol: Python parses constants in the tree
Token: Constant in the Python parse tree
Keyword: Tests Python keywords
Tokenize: Python source file segmentation
Tabnany: fuzzy indentation detection
Pyclbr: Python class browsing support
Py_compile: Compiles Python source files
Compileall: Python library compileall by byte
Dis: disassembler for Python bytecode
Pickletools: Serialization development tool
other
Formatter: Generic formatted output
Windows related
Msilib: Reads and writes the Windows Installer file
MSVCRT: MS VC + + Runtime useful procedures
Winreg: Windows registry access
Winsound: Windows sound player interface
Unix related
Posix: The most commonly used POSIX call
PWD: password database
SPWD: shadow password database
GRP: group database
Crypt: Unix password authentication
Termios: POSIX-style TTY controls
Tty: terminal control function
Pty: pseudo terminal tool
FCNTL: system calls FCNTL () and ioctl()
Pipes: Shell pipe interface
Resource: indicates the available information of resources
Nis: indicates the NIS interface of Sun
Syslog: indicates the Unix log service
This is a brief summary of Python’s built-in modules. Save this article for later retrieval as you work on your project. Hope this article has been helpful to you, and you are welcome to add Python built-in modules that are still commonly used.
The most complete Python collection ever (long term update). The children next door are greedy to cry — click to receive