Python Documentation contents¶
- What’s New in Python
- What’s New In Python 3.14
- What’s New In Python 3.13
- What’s New In Python 3.12
- What’s New In Python 3.11
- What’s New In Python 3.10
- What’s New In Python 3.9
- What’s New In Python 3.8
- What’s New In Python 3.7
- What’s New In Python 3.6
- What’s New In Python 3.5
- What’s New In Python 3.4
- What’s New In Python 3.3
- What’s New In Python 3.2
- What’s New In Python 3.1
- What’s New In Python 3.0
- What’s New in Python 2.7
- What’s New in Python 2.6
- What’s New in Python 2.5
- What’s New in Python 2.4
- What’s New in Python 2.3
- What’s New in Python 2.2
- What’s New in Python 2.1
- What’s New in Python 2.0
- Changelog
- The Python Tutorial
- 1. Whetting Your Appetite
- 2. Using the Python Interpreter
- 3. An Informal Introduction to Python
- 4. More Control Flow Tools
- 5. Data Structures
- 6. Modules
- 7. Input and Output
- 8. Errors and Exceptions
- 9. Classes
- 10. Brief Tour of the Standard Library
- 11. Brief Tour of the Standard Library — Part II
- 12. Virtual Environments and Packages
- 13. What Now?
- 14. Interactive Input Editing and History Substitution
- 15. Floating-Point Arithmetic: Issues and Limitations
- 16. Appendix
- Python Setup and Usage
- The Python Language Reference
- The Python Standard Library
- Introduction
- Built-in Functions
- Built-in Constants
- Built-in Types
- Built-in Exceptions
- Text Processing Services
string— Common string operationsre— Regular expression operationsdifflib— Helpers for computing deltastextwrap— Text wrapping and fillingunicodedata— Unicode Databasestringprep— Internet String Preparationreadline— GNU readline interfacerlcompleter— Completion function for GNU readline
- Binary Data Services
- Data Types
datetime— Basic date and time typeszoneinfo— IANA time zone supportcalendar— General calendar-related functionscollections— Container datatypescollections.abc— Abstract Base Classes for Containersheapq— Heap queue algorithmbisect— Array bisection algorithmarray— Efficient arrays of numeric valuesweakref— Weak referencestypes— Dynamic type creation and names for built-in typescopy— Shallow and deep copy operationspprint— Data pretty printerreprlib— Alternaterepr()implementationenum— Support for enumerationsgraphlib— Functionality to operate with graph-like structures
- Numeric and Mathematical Modules
- Functional Programming Modules
- File and Directory Access
pathlib— Object-oriented filesystem pathsos.path— Common pathname manipulationsfileinput— Iterate over lines from multiple input streamsstat— Interpretingstat()resultsfilecmp— File and Directory Comparisonstempfile— Generate temporary files and directoriesglob— Unix style pathname pattern expansionfnmatch— Unix filename pattern matchinglinecache— Random access to text linesshutil— High-level file operations
- Data Persistence
- Data Compression and Archiving
- File Formats
- Cryptographic Services
- Generic Operating System Services
os— Miscellaneous operating system interfacesio— Core tools for working with streamstime— Time access and conversionsargparse— Parser for command-line options, arguments and sub-commandslogging— Logging facility for Pythonlogging.config— Logging configurationlogging.handlers— Logging handlersgetpass— Portable password inputcurses— Terminal handling for character-cell displayscurses.textpad— Text input widget for curses programscurses.ascii— Utilities for ASCII characterscurses.panel— A panel stack extension for cursesplatform— Access to underlying platform’s identifying dataerrno— Standard errno system symbolsctypes— A foreign function library for Python
- Concurrent Execution
threading— Thread-based parallelismmultiprocessing— Process-based parallelismmultiprocessing.shared_memory— Shared memory for direct access across processes- The
concurrentpackage concurrent.futures— Launching parallel taskssubprocess— Subprocess managementsched— Event schedulerqueue— A synchronized queue classcontextvars— Context Variables_thread— Low-level threading API
- Networking and Interprocess Communication
- Internet Data Handling
email— An email and MIME handling packageemail.message: Representing an email messageemail.parser: Parsing email messagesemail.generator: Generating MIME documentsemail.policy: Policy Objectsemail.errors: Exception and Defect classesemail.headerregistry: Custom Header Objectsemail.contentmanager: Managing MIME Contentemail: Examplesemail.message.Message: Representing an email message using thecompat32APIemail.mime: Creating email and MIME objects from scratchemail.header: Internationalized headersemail.charset: Representing character setsemail.encoders: Encodersemail.utils: Miscellaneous utilitiesemail.iterators: Iterators
json— JSON encoder and decodermailbox— Manipulate mailboxes in various formatsmimetypes— Map filenames to MIME typesbase64— Base16, Base32, Base64, Base85 Data Encodingsbinascii— Convert between binary and ASCIIquopri— Encode and decode MIME quoted-printable data
- Structured Markup Processing Tools
html— HyperText Markup Language supporthtml.parser— Simple HTML and XHTML parserhtml.entities— Definitions of HTML general entities- XML Processing Modules
xml.etree.ElementTree— The ElementTree XML APIxml.dom— The Document Object Model APIxml.dom.minidom— Minimal DOM implementationxml.dom.pulldom— Support for building partial DOM treesxml.sax— Support for SAX2 parsersxml.sax.handler— Base classes for SAX handlersxml.sax.saxutils— SAX Utilitiesxml.sax.xmlreader— Interface for XML parsersxml.parsers.expat— Fast XML parsing using Expat
- Internet Protocols and Support
webbrowser— Convenient web-browser controllerwsgiref— WSGI Utilities and Reference Implementationurllib— URL handling modulesurllib.request— Extensible library for opening URLsurllib.response— Response classes used by urlliburllib.parse— Parse URLs into componentsurllib.error— Exception classes raised by urllib.requesturllib.robotparser— Parser for robots.txthttp— HTTP moduleshttp.client— HTTP protocol clientftplib— FTP protocol clientpoplib— POP3 protocol clientimaplib— IMAP4 protocol clientsmtplib— SMTP protocol clientuuid— UUID objects according to RFC 4122socketserver— A framework for network servershttp.server— HTTP servershttp.cookies— HTTP state managementhttp.cookiejar— Cookie handling for HTTP clientsxmlrpc— XMLRPC server and client modulesxmlrpc.client— XML-RPC client accessxmlrpc.server— Basic XML-RPC serversipaddress— IPv4/IPv6 manipulation library
- Multimedia Services
- Internationalization
- Program Frameworks
- Graphical User Interfaces with Tk
- Development Tools
typing— Support for type hintspydoc— Documentation generator and online help system- Python Development Mode
doctest— Test interactive Python examplesunittest— Unit testing frameworkunittest.mock— mock object libraryunittest.mock— getting startedtest— Regression tests package for Pythontest.support— Utilities for the Python test suitetest.support.socket_helper— Utilities for socket teststest.support.script_helper— Utilities for the Python execution teststest.support.bytecode_helper— Support tools for testing correct bytecode generationtest.support.threading_helper— Utilities for threading teststest.support.os_helper— Utilities for os teststest.support.import_helper— Utilities for import teststest.support.warnings_helper— Utilities for warnings tests
- Debugging and Profiling
- Software Packaging and Distribution
- Python Runtime Services
sys— System-specific parameters and functionssys.monitoring— Execution event monitoringsysconfig— Provide access to Python’s configuration informationbuiltins— Built-in objects__main__— Top-level code environmentwarnings— Warning controldataclasses— Data Classescontextlib— Utilities forwith-statement contextsabc— Abstract Base Classesatexit— Exit handlerstraceback— Print or retrieve a stack traceback__future__— Future statement definitionsgc— Garbage Collector interfaceinspect— Inspect live objectsannotationlib— Functionality for introspecting annotationssite— Site-specific configuration hook
- Custom Python Interpreters
- Importing Modules
zipimport— Import modules from Zip archivespkgutil— Package extension utilitymodulefinder— Find modules used by a scriptrunpy— Locating and executing Python modulesimportlib— The implementation ofimportimportlib.resources– Package resource reading, opening and accessimportlib.resources.abc– Abstract base classes for resourcesimportlib.metadata– Accessing package metadata- The initialization of the
sys.pathmodule search path
- Python Language Services
ast— Abstract Syntax Treessymtable— Access to the compiler’s symbol tablestoken— Constants used with Python parse treeskeyword— Testing for Python keywordstokenize— Tokenizer for Python sourcetabnanny— Detection of ambiguous indentationpyclbr— Python module browser supportpy_compile— Compile Python source filescompileall— Byte-compile Python librariesdis— Disassembler for Python bytecodepickletools— Tools for pickle developers
- MS Windows Specific Services
- Unix Specific Services
posix— The most common POSIX system callspwd— The password databasegrp— The group databasetermios— POSIX style tty controltty— Terminal control functionspty— Pseudo-terminal utilitiesfcntl— Thefcntlandioctlsystem callsresource— Resource usage informationsyslog— Unix syslog library routines
- Modules command-line interface (CLI)
- Superseded Modules
- Security Considerations
- Extending and Embedding the Python Interpreter
- Python/C API Reference Manual
- Introduction
- C API Stability
- The Very High Level Layer
- Reference Counting
- Exception Handling
- Utilities
- Abstract Objects Layer
- Concrete Objects Layer
- Type Objects
- The
NoneObject - Integer Objects
- Boolean Objects
- Floating-Point Objects
- Complex Number Objects
- Bytes Objects
- Byte Array Objects
- Unicode Objects and Codecs
- Tuple Objects
- Struct Sequence Objects
- List Objects
- Dictionary Objects
- Set Objects
- Function Objects
- Instance Method Objects
- Method Objects
- Cell Objects
- Code Objects
- Extra information
- File Objects
- Module Objects
- Iterator Objects
- Descriptor Objects
- Slice Objects
- MemoryView objects
- Weak Reference Objects
- Capsules
- Frame Objects
- Generator Objects
- Coroutine Objects
- Context Variables Objects
- DateTime Objects
- Objects for Type Hinting
- Initialization, Finalization, and Threads
- Python Initialization Configuration
- Memory Management
- Object Implementation Support
- API and ABI Versioning
- Monitoring C API
- Generating Execution Events
- Installing Python Modules
- Python HOWTOs
- Python Frequently Asked Questions
- Deprecations
- Glossary
- About these documents
- Dealing with Bugs
- Copyright
- History and License