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 includes
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. Python Runtime Services
- 28. Custom Python Interpreters
- 29. Restricted Execution
- 30. Importing Modules
- 31. Python Language Services
- 32. Python compiler package
- 33. Miscellaneous Services
- 34. MS Windows Specific Services
- 35. Unix Specific Services
- 36. Mac OS X specific services
- 37. MacPython OSA Modules
- 38. SGI IRIX Specific Services
- 39. SunOS Specific Services
- 40. Undocumented Modules