Staging: this is not the live site, pydocs.org.
Text Processing Services difflib Helpers for computing differences between objects. re Regular expression operations. readline GNU readline support for Python. rlcompleter Python identifier completion, suitable for the GNU readline library. string Common string operations. Binary Data Services codecs Encode and decode data and streams. struct Interpret bytes as packed binary data. Data Types array Space efficient arrays of uniformly typed numeric values. bisect Array bisection algorithms for binary searching. calendar Functions for working with calendars, including some emulation of the Unix cal program. copy Shallow and deep copy operations. enum Implementation of an enumeration class. graphlib Functionality to operate with graph-like structures heapq Heap queue algorithm (a.k.a. priority queue). reprlib Alternate repr() implementation with size limits. types Names for built-in types. weakref Support for weak references and weak dictionaries. Numeric and Mathematical Modules cmath Mathematical functions for complex numbers. decimal Implementation of the General Decimal Arithmetic Specification. math Mathematical functions (sin() etc.). numbers Numeric abstract base classes (Complex, Real, Integral, etc.). random Generate pseudo-random numbers with various common distributions. Functional Programming Modules functools Higher-order functions and operations on callable objects. itertools Functions creating iterators for efficient looping. operator Functions corresponding to the standard operators. File and Directory Access fnmatch Unix shell style filename pattern matching. glob Unix shell style pathname pattern expansion. linecache Provides random access to individual lines from text files. pathlib Object-oriented filesystem paths shutil High-level file operations, including copying. stat Utilities for interpreting the results of os.stat(), os.lstat() and os.fstat(). tempfile Generate temporary files and directories. Data Persistence copyreg Register pickle support functions. dbm Interfaces to various Unix "database" formats. dbm.dumb Portable implementation of the simple DBM interface. marshal Convert Python objects to streams of bytes and back (with different constraints). pickle Convert Python objects to streams of bytes and back. shelve Python object persistence. sqlite3 A DB-API 2.0 implementation using SQLite 3.x. Data Compression and Archiving bz2 Interfaces for bzip2 compression and decompression. compression The compression package contains the canonical compression modules containing interfaces to several different compression algorithms. compression.zstd Low-level interface to compression and decompression routines in the zstd library. gzip Interfaces for gzip compression and decompression using file objects. lzma A Python wrapper for the liblzma compression library. tarfile Read and write tar-format archive files. zipfile Read and write ZIP-format archive files. zlib Low-level interface to compression and decompression routines compatible with gzip. csv Write and read tabular data to and from delimited files. netrc Loading of .netrc files. plistlib Generate and parse Apple plist files. Cryptographic Services hashlib Secure hash and message digest algorithms. hmac Keyed-Hashing for Message Authentication (HMAC) implementation secrets Generate secure random numbers for managing secrets. Generic Operating System Services ctypes A foreign function library for Python. errno Standard errno system symbols. io Core tools for working with streams. logging Flexible event logging system for applications. os Miscellaneous operating system interfaces. platform Retrieves as much platform identifying data as possible. time Time access and conversions. Command-line interface libraries argparse Command-line option and argument parsing library. cmd Build line-oriented command interpreters. curses An interface to the curses library, providing portable terminal handling. curses.ascii Constants and set-membership functions for ASCII characters. curses.panel A panel stack extension that adds depth to curses windows. fileinput Loop over standard input or a list of files. getpass Portable reading of passwords and retrieval of the userid. optparse Command-line option parsing library. Concurrent Execution queue A synchronized queue class. sched General purpose event scheduler. Networking and Interprocess Communication mmap Interface to memory-mapped files for Unix and Windows. select Wait for I/O completion on multiple streams. signal Set handlers for asynchronous events. socket Low-level networking interface. ssl TLS/SSL wrapper for socket objects Internet Data Handling base64 RFC 4648: Base16, Base32, Base64 Data Encodings; Base85 and Ascii85 binascii Tools for converting between binary and various ASCII-encoded binary representations. email Package supporting the parsing, manipulating, and generating email messages. email.errors The exception classes used by the email package. email.parser Parse flat text email messages to produce a message object structure. email.policy Controlling the parsing and generating of messages json Encode and decode the JSON format. json.tool A command-line interface to validate and pretty-print JSON. mailbox Manipulate mailboxes in various formats mimetypes Mapping of filename extensions to MIME types. quopri Encode and decode files using the MIME quoted-printable encoding. html Helpers for manipulating HTML. html.parser A simple parser that can handle HTML and XHTML. xml Package containing XML processing modules xml.dom Document Object Model API for Python. xml.sax Package containing SAX2 base classes and convenience functions. Internet Protocols and Support ftplib FTP protocol client (requires sockets). http HTTP status codes and messages http.client HTTP and HTTPS protocol client (requires sockets). imaplib IMAP4 protocol client (requires sockets). poplib POP3 protocol client (requires sockets). smtplib SMTP protocol client (requires sockets). urllib urllib is a package that collects several modules for working with URLs: urllib.parse Parse URLs into or assemble them from components. urllib.robotparser Load a robots.txt file and answer questions about fetchability of other URLs. uuid UUID objects (universally unique identifiers) according to RFC 9562 webbrowser Easy-to-use controller for web browsers. wsgiref WSGI Utilities and Reference Implementation. xmlrpc Server and client modules implementing XML-RPC. colorsys Conversion functions between RGB and other color systems. wave Provide an interface to the WAV sound format. Internationalization gettext Multilingual internationalization services. locale Internationalization services. Graphical user interfaces with Tk _tkinter A binary module that contains the low-level interface to Tcl/Tk. idlelib Implementation package for the IDLE shell/editor. tkinter Interface to Tcl/Tk for graphical user interfaces turtle An educational framework for simple graphics applications doctest Test pieces of code within docstrings. pydoc Documentation generator and online help system. test Regression tests package containing the testing suite for Python. typing Support for type hints (see :pep:`484`). unittest Unit testing framework for Python. Debugging and profiling pdb The Python debugger for interactive interpreters. profiling Python profiling tools for performance analysis. pstats Statistics object for analyzing profiler output. timeit Measure the execution time of small code snippets. trace Trace or track Python statement execution. Software Packaging and Distribution ensurepip Bootstrapping the "pip" installer into an existing Python installation or virtual environment. venv Creation of virtual environments. zipapp Manage executable Python zip archives Python Runtime Services __main__ The environment where top-level code is run. Covers command-line interfaces, import-time behavior, and ``__name__ == '__main__'``. abc Abstract base classes according to :pep:`3119`. atexit Register and execute cleanup functions. builtins The module that provides the built-in namespace. dataclasses Generate special methods on user-defined classes. gc Interface to the cycle-detecting garbage collector. inspect Extract information and source code from live objects. site Module responsible for site-specific configuration. sitecustomize After these path manipulations, an attempt is made to import a module named sitecustomize, which can perform arbitrary site-specific customizations. sys Access system-specific parameters and functions. traceback Print or retrieve a stack traceback. usercustomize After this, an attempt is made to import a module named usercustomize, which can perform arbitrary user-specific customizations, if ENABLE_USER_SITE is true. warnings Issue warning messages and control their disposition. Custom Python Interpreters code Facilities to implement read-eval-print loops. codeop Compile (possibly incomplete) Python code. Importing Modules importlib The implementation of the import machinery. pkgutil Utilities for the import system. runpy Locate and run Python modules without importing them first. zipimport Support for importing Python modules from ZIP archives. Python Language Services ast Abstract Syntax Tree classes and manipulation. compileall Tools for byte-compiling all Python source files in a directory tree. dis Disassembler for Python bytecode. keyword Test whether a string is a keyword in Python. pickletools Contains extensive comments about the pickle protocols and pickle-machine opcodes, as well as some useful functions. py_compile Generate byte-code files from Python source files. pyclbr Supports information extraction for a Python module browser. symtable Interface to the compiler's internal symbol tables. tabnanny Tool for detecting white space related problems in Python source files in a directory tree. token Constants representing terminal nodes of the parse tree. tokenize Lexical scanner for Python source code. MS Windows Specific Services msvcrt Miscellaneous useful routines from the MS VC++ runtime. winreg Routines and objects for manipulating the Windows registry. winsound Access to the sound-playing machinery for Windows. Unix-specific services fcntl The fcntl() and ioctl() system calls. grp The group database (getgrnam() and friends). posix The most common POSIX system calls (normally used via module os). pty Pseudo-Terminal Handling for Unix. pwd The password database (getpwnam() and friends). resource An interface to provide resource usage information on the current process. shlex Simple lexical analysis for Unix shell-like languages. syslog An interface to the Unix syslog library routines. tty Utility functions that perform common terminal control operations. Superseded modules getopt Portable parser for command line options; support both short and long option names. profile Pure Python profiler (deprecated).
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF