The Python Standard Library
While The Python Language Reference describes the exact syntax and
semantics of the Python language, this library reference manual
describes the standard library that is distributed with Python. It also
describes some of the optional components that are commonly included
in Python distributions.
Python’s standard library is very extensive, offering a wide range of
facilities as indicated by the long table of contents listed below. The
library contains built-in modules (written in C) that provide access to
system functionality such as file I/O that would otherwise be
inaccessible to Python programmers, as well as modules written in Python
that provide standardized solutions for many problems that occur in
everyday programming. Some of these modules are explicitly designed to
encourage and enhance the portability of Python programs by abstracting
away platform-specifics into platform-neutral APIs.
The Python installers for the Windows platform usually include
the entire standard library and often also include many additional
components. For Unix-like operating systems Python is normally provided
as a collection of packages, so it may be necessary to use the packaging
tools provided with the operating system to obtain some or all of the
optional components.
In addition to the standard library, there is a growing collection of
several thousand components (from individual programs and modules to
packages and entire application development frameworks), available from
the Python Package Index.
- 1. Introduction
- 2. Built-in Functions
- 3. Non-essential Built-in Functions
- 4. Built-in Constants
- 5. Built-in Types
- 5.1. Truth Value Testing
- 5.2. Boolean Operations — and, or, not
- 5.3. Comparisons
- 5.4. Numeric Types — int, float, long, complex
- 5.5. Iterator Types
- 5.6. Sequence Types — str, unicode, list, tuple, bytearray, buffer, xrange
- 5.7. Set Types — set, frozenset
- 5.8. Mapping Types — dict
- 5.9. File Objects
- 5.10. memoryview type
- 5.11. Context Manager Types
- 5.12. Other Built-in Types
- 5.13. Special Attributes
- 6. Built-in Exceptions
- 7. String Services
- 8. Data Types
- 9. Numeric and Mathematical Modules
- 10. File and Directory Access
- 11. Data Persistence
- 12. Data Compression and Archiving
- 13. File Formats
- 14. Cryptographic Services
- 15. Generic Operating System Services
- 16. Optional Operating System Services
- 17. Interprocess Communication and Networking
- 18. Internet Data Handling
- 19. Structured Markup Processing Tools
- 20. Internet Protocols and Support
- 21. Multimedia Services
- 22. Internationalization
- 23. Program Frameworks
- 24. Graphical User Interfaces with Tk
- 25. Development Tools
- 26. Debugging and Profiling
- 27. Software Packaging and Distribution
- 28. Python Runtime Services
- 29. Custom Python Interpreters
- 30. Restricted Execution
- 31. Importing Modules
- 32. Python Language Services
- 33. Python compiler package
- 34. Miscellaneous Services
- 35. MS Windows Specific Services
- 36. Unix Specific Services
- 37. Mac OS X specific services
- 38. MacPython OSA Modules
- 39. SGI IRIX Specific Services
- 40. SunOS Specific Services
- 41. Undocumented Modules