A summary of 200 Python standard libraries!

Text

string: General string operation

re: regular expression operation

difflib: difference calculation tool

textwrap: text filling

unicodedata: Unicode character database

stringprep: Internet string preparation tool

readline: GNU read line by line interface

rlcompleter: GNU read-by-line implementation function

struct: Parse bytes into packed binary data

codecs: Codecs for registry and base classes

type of data

datetime: date and time based tools

calendar: general month function

collections: container data type

collections.abc: container virtual base class

heapq: heap queue algorithm

bisect: array dichotomy algorithm

array: efficient numeric array

weakref: weak reference

types: Dynamic creation and naming of built-in types

copy: shallow copy and deep copy

reprlib: alternate repr() implementation

Mathematics

numbers: virtual base class for numbers

math: mathematical function

cmath: mathematical function of complex numbers

decimal: fixed-point and floating-point calculations

fractions: rational number

random: Generate pseudo-random numbers

Functional programming

itertools: Generate iterators for efficient loops

functools: higher-order functions and operations on callable objects

operator: standard operations for functions

Files and directories

os.path: General path name control

fileinput: Traverse lines from multiple input streams

stat: explain the result of stat()

filecmp: Comparison function of files and directories

tempfile: Generate temporary files and directories

glob: Unix-style path name format extension

fnmatch: Unix-style path name format comparison

linecache: random storage of text lines

shutil: advanced file operations

macpath: MacOS 9 path control function

Persistence

pickle: Python object serialization

copyreg: the support function of the registration machine for pickle

shelve: Python object persistence

marshal: internal Python object serialization

dbm: Unix "database" interface

sqlite3: API2.0 for SQLite database

Compression

zlib: Compatible with gzip compression

gzip: support for gzip files

bz2: support for bzip2 compression

lzma: compression using the LZMA algorithm

zipfile: manipulate ZIP archives

tarfile: read and write tar archive files

Encryption

hashlib: secure hash and message digest

hmac: key hash for message authentication

Operating system tools

os: Various operating system interfaces

io: Streaming core tool

time: query and conversion of time

argparser: a parser for command line options, arguments and subcommands

optparser: command line option parser

getopt: C-style command line option parser

logging: Python logging tool

logging.config: Log configuration

logging.handlers: log handler

getpass: simple password input

curses: terminal processing of character display

curses.textpad: text input field of curses program

curses.ascii: ASCII character set tool

curses.panel: Curses control stack extension

platform: access to the underlying platform authentication data

errno: standard error notation

ctypes: Python external function library

Concurrency

threading: thread-based parallelism

multiprocessing: process-based parallelism

concurrent: concurrent package

concurrent.futures: start parallel tasks

subprocess: subprocess management

sched: event scheduling

queue: synchronization queue

select: wait for I/O to complete

dummy_threading: Alternative to threading module (when _thread is not available)

_ thread: the underlying thread API (threading is based on it)

_ dummy_thread: Alternative to _thread module (when _thread is not available)

Inter-process communication

socket: low-level network interface

ssl: TLS/SSL filler for socket objects

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: multiple formats to control mailboxes

mimetypes: file name and MIME type mapping

base64: RFC3548: Base16, Base32, Base64 encoding

binhex: binhex4 file encoding and decoding

binascii: Conversion between binary code and ASCII code

quopri: MIMEquoted-encoding and decoding of printable data

uu: encoding and decoding of uuencode files

Internet Protocol and Support

webbrowser: Simple web browser controller

cgi: CGI support

cgitb: CGI script reverse tracking manager

wsgiref: WSGI tool and reference implementation

urllib: URL processing module

urllib.request: Open the extension library for URL connection

urllib.response: the response class of the urllib module

urllib.parse: parse URL into components

urllib.error: Exception class raised by urllib.request

urllib.robotparser: parser for robots.txt

http: HTTP module

http.client: HTTP protocol client

ftplib: FTP protocol client

poplib: POP protocol client

imaplib: IMAP4 protocol client

nntplib: NNTP protocol client

smtplib: SMTP protocol client

smtpd: SMTP server

telnetlib: Telnet client

uuid: UUID object of RFC4122

socketserver: web server framework

http.server: HTTP server

http.cookies: HTTPCookie state manager

http.cookiejar: Cookie processing of HTTP client

xmlrpc: XML-RPC server and client module

xmlrpc.client: XML-RPC client access

xmlrpc.server: XML-RPC server foundation

ipaddress: IPv4/IPv6 control library

Multimedia

audioop: Process raw audio data

aifc: Read and write AIFF and AIFC files

sunau: Read and write Sun AU files

wave: read and write WAV files

chunk: read IFF large files

colorsys: Conversion between color systems

imghdr: Specify the image type

sndhdr: Specify the sound file type

ossaudiodev: Access to OSS compatible audio devices

globalization

gettext: multilingual international service

locale: Internationalization 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

development tools

pydoc: Documentation generator and online help system

doctest: Interactive Python example

unittest: unit testing framework

unittest.mock: mock object library

test: Python regression test package

test.support: Python test tool suite

venv: virtual environment construction

Debugging

bdb: debugging framework

faulthandler: Python reverse tracking library

pdb: Python debugger

timeit: measure the execution time of a small piece of code

trace: Python execution status tracking

Runtime

sys: system-related parameters and functions

sysconfig: Access Python configuration information

builtins: built-in objects

main: top-level script environment

warnings: warning control

contextlib: context tool for with state

abc: virtual base class

atexit: export processor

traceback: print or read a stack traceback

future: future state definition

gc: Garbage collection interface

inspect: inspect live objects

site: site-related configuration hook (hook)

fpectl: floating point exception control

distutils: Generate and install Python modules

Interpreter

code: base class interpreter

codeop: Compile Python code

Import module

imp: access the inside of the import module

zipimport: Import modules from ZIP archive

pkgutil: package expansion tool

modulefinder: Find modules through scripts

runpy: locate and execute Python modules

importlib: an implementation of import

Python language

parser: access the Python parse tree

ast: abstract syntax tree

symtable: access to the compiler symbol table

symbol: Constants in the Python parse tree

token: Constant in the Python parse tree

keyword: Python keyword test

tokenize: Python source file tokenization

tabnany: fuzzy indentation detection

pyclbr: Python class browsing support

py_compile: Compile Python source files

compileall: Compile Python libraries by byte

dis: Disassembler for Python bytecode

pickletools: serialization development tools

Other

formatter: general formatted output

Windows related

msilib: Read and write Windows Installer files

msvcrt: a useful program for MS VC + + Runtime

winreg: Windows registry access

winsound: Windows sound playback interface

Unix related

posix: The most commonly used POSIX call

pwd: password database

spwd: shadow password database

grp: group database

crypt: Unix password verification

termios: POSIX style tty control

tty: terminal control function

pty: pseudo terminal tool

fcntl: system calls fcntl() and ioctl()

pipes: shell pipe interface

resource: resource availability information

nis: Sun's NIS interface

syslog: Unix log service

The above is a brief summary of the various built-in modules of Python. You can bookmark this article and retrieve it later when you are working on a project. I hope this article can help you, and welcome to add some commonly used Python built-in modules.

Recommended Posts

A summary of 200 Python standard libraries!
A brief summary of the difference between Python2 and Python3
A large inventory of commonly used third-party libraries in Python
Summary of Python calling private attributes
Installation of python common libraries under windows
Comprehensive summary of Python built-in exception types
Analysis of glob in python standard library
Summary of knowledge points about Python unpacking
Python- crawl all pictures of a station
7 features of Python3.9
Python basic summary
Detailed explanation of python standard library OS module
Recommendations of a few websites for learning Python
Python drawing | A variety of typhoon path visualization methods
How does python call the key of a dictionary
Python interview questions summary
Basics of Python syntax
How to understand a list of numbers in python
Python advanced usage summary
Basic syntax of Python
Basic knowledge of Python (1)
Prettytable module of python
09. Common modules of Python3
Summary of ubuntu usage
How to find the area of a circle in python
Python defines a function method
Consolidate the foundation of Python (4)
Python high-order function usage summary!
Consolidate the foundation of Python(7)
In-depth understanding of python list (LIST)
Subscripts of tuples in Python
Python analysis of wav files
Consolidate the foundation of Python(6)
Python implements a guessing game
Python datetime processing time summary
Analysis of JS of Python crawler
python king of glory wallpaper
Consolidate the foundation of Python(5)
Python implementation of gomoku program
Analysis of Python Sandbox Escape
Some new features of Python 3.10
Deep understanding of Python multithreading
Analysis of Python object-oriented programming
LeetCode brushing questions summary python3
Python version of OpenCV installation
Summary of various ubuntu problems
9 feature engineering techniques of Python
matplotlib of python drawing module
Python method of parameter passing
Consolidate the foundation of Python (3)
Collection of Python Common Modules
Python high-order function usage summary!