„Batteries included“¶
In Python, a library can consist of several components, including built-in data types and constants that can be used without an import statement, such as Numbers and Lists, as well as some built-in Functions and Exceptions. The largest part of the library is an extensive collection of Modules. If you have Python installed, there are also several libraries available for you to use.
Managing data types¶
The standard library naturally contains support for the types built into Python. In addition, there are three categories in the standard library that deal with different data types: Modules for strings, datatypes and numbers.
String modules¶
Module |
Description |
---|---|
compares with constants such as |
|
searches and replaces text with regular expressions |
|
interprets bytes as packed binary data |
|
helps to calculate deltas, find differences between strings or sequences and create patches and diff files |
|
wraps and fills text, formats text with line breaks or spaces |
Modules for data types¶
Module |
Description |
---|---|
Time and calendar operations |
|
Container data types |
|
allows the creation of enumeration classes that bind symbolic names to constant values |
|
Efficient arrays of numeric values |
|
Event scheduler |
|
Synchronised queue class |
|
Shallow and deep copy operations |
|
prints Python data structures „pretty“. |
|
supports commenting code with hints about the types of objects, especially function parameters and return values |
Modules for numbers¶
Module |
Description |
---|---|
for numeric abstract base classes |
|
for mathematical functions for real and complex numbers |
|
for decimal fixed-point and floating-point arithmetic |
|
for functions for calculating mathematical statistics |
|
for rational numbers |
|
for generating pseudo-random numbers and selections and for shuffling sequences |
|
for functions that create iterators for efficient loops |
|
for higher-order functions and operations on callable objects |
|
for standard operators as functions |
Changing files¶
Interacting with the operating system¶
Module |
Description |
---|---|
Various operating system interfaces |
|
Access to the identification data of the underlying platform |
|
Time access and conversions |
|
Tools for working with data streams |
|
Waiting for I/O completion |
|
Parser for command line options |
|
Terminal handling for character cell displays |
|
Portable password entry |
|
provides C-compatible data types |
|
high-level threading interface |
|
Process-based threading interface |
|
Management of subprocesses |
Use of Internet protocols¶
Module |
description |
---|---|
Low-level network interface and SSL wrapper for socket objects |
|
Email and MIME processing package |
|
Manipulation of mailboxes in various formats |
|
Common Gateway Interface support |
|
WSGI utilities and reference implementation |
|
Open and parse URLs |
|
Clients for various Internet protocols |
|
Framework for network servers |
|
HTTP server |
|
XML-RPC client and server |
Developing and debugging¶
Module |
Description |
---|---|
Documentation generator and online help system |
|
Test examples from Python docstrings |
|
Framework for unittests, see also Unittest |
|
Utility functions for tests |
|
traces the execution of Python statements |
|
Python debugger |
|
logging function for Python |
|
measures the execution time of small code snippets |
|
Python profiler |
|
System-specific parameters and functions |
|
Functions of the Python garbage collector |
|
inspects objects live |
|
exit handler |
|
Future statement definitions |
|
allows access to the import internals |
|
imports modules from zip archives |
|
finds modules used by a script |