Built-in Modules¶
Halaman ini mencantumkan modul bawaan yang disertakan dengan Pustaka Standar Python 3.13.
Modul-modul ini tersedia tanpa instalasi tambahan (beberapa bergantung pada platform).
A¶
Module |
Description |
Introduced |
|---|---|---|
Tools for defining Abstract Base Classes (interfaces for Python classes). |
2.6 |
|
Read and write AIFF/AIFF-C audio files. Deprecated since version 3.11. |
1.5.2 |
|
Parse command line arguments and create user-friendly CLIs. |
2.7 |
|
Efficient arrays of basic numeric types (compact alternative to lists). |
1.0 |
|
Work with Python code as an Abstract Syntax Tree (analyze or transform code). |
2.6 |
|
Write concurrent code using the async/await syntax (event loop, tasks, IO). |
3.4 |
|
Register functions to run automatically when the program exits. |
2.0 |
B¶
Module |
Description |
Introduced |
|---|---|---|
Encode and decode data using Base16, Base32, Base64, etc. |
2.0 |
|
Debugger framework used by pdb (implements the core debugging logic). |
— |
|
Convert between binary and ASCII (hex, base64 helpers at C speed). |
2.0 |
|
Maintain sorted lists; insert and search with binary search. |
2.0 |
|
Access Python’s built-in objects like len, range, and exceptions. |
3.0 |
|
Read and write bzip2-compressed files and streams. |
2.3 |
C¶
Module |
Description |
Introduced |
|---|---|---|
Work with dates as calendars; print text calendars and compute month info. |
2.0 |
|
Helpers for Common Gateway Interface (legacy web server scripts). |
2.0 |
|
Pretty tracebacks for CGI scripts (HTML formatted error reports). |
— |
|
Build simple line-oriented command interpreters (REPL-like shells). |
2.0 |
|
Run an interactive interpreter or embed one in your program. |
2.0 |
|
Text encodings and decoding/encoding helpers. |
2.0 |
|
Compile Python code objects conditionally (used by code editors and shells). |
2.0 |
|
High-performance container datatypes like deque, Counter, namedtuple. |
2.4 |
|
Convert between color systems: RGB, YIQ, HLS, HSV. |
2.0 |
|
Concurrency framework (futures) for running callables asynchronously. |
3.2 |
|
Read and write INI-style configuration files. |
3.0 |
|
Utilities for context managers and the with-statement. |
2.5 |
|
Context-local storage for async code (like thread-local, but for tasks). |
3.7 |
|
Shallow and deep copy operations for Python objects. |
2.0 |
|
Register custom pickling functions for complex objects. |
3.0 |
|
Read and write CSV files (comma-separated values) with ease. |
2.3 |
|
Call C libraries and work with C-compatible data types. |
2.5 |
|
Terminal handling for character-cell UIs (Unix-like systems only). |
2.0 |
D¶
Module |
Description |
Introduced |
|---|---|---|
Decorator and helpers for classes that store data (auto-generate init, repr, etc.). |
3.7 |
|
Dates, times, time zones, and timedeltas made simple and precise. |
2.3 |
|
Family of simple on-disk key/value databases (backed by platform libs). |
2.0 |
|
Fixed-point and floating decimal arithmetic for money and exact math. |
2.4 |
|
Compare sequences and create human-readable diffs. |
2.1 |
|
Disassemble Python bytecode for inspection and debugging. |
2.0 |
|
Test examples embedded in docstrings (keeps docs and code in sync). |
2.1 |
E¶
Module |
Description |
Introduced |
|---|---|---|
Parse, build, and send email messages (headers, MIME, attachments). |
2.2 |
|
Implementation of text encodings used by Python’s codec system. |
2.0 |
|
Bootstraps pip into a Python installation. |
3.4 |
|
Define enumerations (named constants) with nice semantics. |
3.4 |
|
Standard error number constants from the OS. |
2.0 |
F¶
Module |
Description |
Introduced |
|---|---|---|
Dump Python tracebacks on a crash or on demand (helps debug hard faults). |
3.3 |
|
Compare files and directories to see what changed. |
2.0 |
|
Loop over lines from stdin or a list of files as a single stream. |
2.0 |
|
Match filenames using shell-style wildcards. |
2.0 |
|
Rational numbers (Fractions) for exact arithmetic. |
2.6 |
|
FTP client library for transferring files. |
2.0 |
|
Higher-order functions and utilities (lru_cache, partial, wraps, etc.). |
2.5 |
G¶
Module |
Description |
Introduced |
|---|---|---|
Control the garbage collector and inspect tracked objects. |
2.0 |
|
Parse command-line options (POSIX-style). |
1.5.2 |
|
Prompt for a password without echoing it to the console. |
2.0 |
|
Internationalization (i18n) support for translating messages. |
2.3 |
|
Find pathnames matching a pattern like *.py. |
2.0 |
|
Topological sorting utilities for dependency graphs. |
3.9 |
|
Read and write gzip-compressed files and streams. |
2.0 |
H¶
Module |
Description |
Introduced |
|---|---|---|
Secure hashes and message digests (SHA, MD5, BLAKE2, etc.). |
2.5 |
|
Heap queue (priority queue) algorithms on plain lists. |
2.3 |
|
Keyed-hash message authentication codes (HMAC). |
2.2 |
|
HTML helpers (escape/unescape text). |
3.2 |
|
HTTP modules package (client, server, cookies). |
3.0 |
I¶
Module |
Description |
Introduced |
|---|---|---|
Support for the IDLE interactive Python environment. |
— |
|
IMAP4 client library for accessing email servers. |
2.0 |
|
Determine the type of an image file. |
2.0 |
|
Access the import internals (deprecated; use importlib). |
— |
|
Programmatic interface to Python’s import mechanism. |
3.1 |
|
Inspect live objects such as modules, classes, and functions. |
— |
|
Input/Output streams and buffering (text and binary). |
2.6 |
J¶
Module |
Description |
Introduced |
|---|---|---|
Encode and decode JSON data (JavaScript Object Notation). |
2.6 |
K¶
Module |
Description |
Introduced |
|---|---|---|
Test for Python keywords; list all keywords. |
— |
L¶
Module |
Description |
Introduced |
|---|---|---|
Read text lines from files with random access. |
2.0 |
|
Internationalization (i18n) support for formatting numbers and dates. |
2.0 |
|
Flexible event logging system with various handlers. |
2.3 |
|
Compression using the LZMA algorithm (xz format). |
3.3 |
M¶
Module |
Description |
Introduced |
|---|---|---|
Work with various mailbox formats (mbox, Maildir, etc.). |
2.3 |
|
Read mailcap files (MIME handlers configuration). |
2.0 |
|
Read and write Python values in a binary format (for .pyc internals). |
— |
|
Fast math functions: trigonometry, logarithms, constants, etc. |
— |
|
Guess a file’s type based on its filename or URL. |
2.0 |
|
Memory-map files for efficient random access. |
2.0 |
|
Find modules used by a script (dependency scanning). |
— |
|
Create and read Microsoft Installer (.msi) files (Windows only). |
— |
|
Access to Microsoft C runtime routines (Windows only). |
— |
|
Run code in parallel using processes (bypass the GIL). |
2.6 |
N¶
Module |
Description |
Introduced |
|---|---|---|
Parse .netrc files for machine login credentials. |
2.0 |
|
Client for NNTP (Usenet) news servers. |
2.0 |
|
Abstract base classes for numeric types. |
2.6 |
|
Interface to Sun’s NIS (Yellow Pages) service (Unix platforms). |
— |
|
Windows path operations (used by os.path on Windows). |
2.0 |
O¶
Module |
Description |
Introduced |
|---|---|---|
Functional interface to operators (add, mul, itemgetter, attrgetter). |
1.5.2 |
|
Deprecated parser for command line options (use argparse). |
2.3 |
|
Operating system interfaces: files, environment, processes. |
— |
P¶
Module |
Description |
Introduced |
|---|---|---|
Object-oriented filesystem paths. |
3.4 |
|
Interactive debugger for Python programs. |
2.0 |
|
Serialize and deserialize Python objects (not secure against untrusted data). |
2.0 |
|
Tools for analyzing pickled data. |
2.3 |
|
Pipe shell commands together (Unix). |
2.0 |
|
Utilities for packages: walk packages, find loaders, etc. |
2.3 |
|
Access to underlying platform information. |
2.3 |
|
Read and write Apple .plist files. |
2.6 |
|
POP3 email client. |
2.0 |
|
POSIX APIs (Unix-only, low-level). |
2.0 |
|
Pretty-print Python data structures. |
2.0 |
|
Deterministic profiling of Python programs. |
2.0 |
|
Work with profiling results produced by profile/cProfile. |
2.0 |
|
Pseudo-terminal utilities (Unix). |
2.0 |
|
Read module to get class browser information without importing it. |
2.0 |
|
Generate and view Python documentation. |
2.1 |
|
Compile Python source files to bytecode. |
2.0 |
Q¶
Module |
Description |
Introduced |
|---|---|---|
Thread-safe FIFO/LIFO/priority queues. |
2.6 |
|
Encode/decode MIME quoted-printable data. |
2.0 |
R¶
Module |
Description |
Introduced |
|---|---|---|
Generate pseudo-random numbers for various distributions. |
2.0 |
|
Regular expression operations for pattern matching in strings. |
2.0 |
|
Safe string representations for large or recursive structures. |
3.0 |
|
Control and query system resource limits (Unix). |
2.0 |
|
Tab-completion support for the interactive interpreter. |
2.0 |
|
Run modules as scripts (like python -m). |
2.5 |
S¶
Module |
Description |
Introduced |
|---|---|---|
Event scheduler for running functions at specific times. |
2.0 |
|
Generate cryptographically strong random numbers and tokens. |
3.6 |
|
Low-level I/O multiplexing (select, poll, epoll, kqueue). |
2.0 |
|
High-level I/O multiplexing built on select module. |
3.4 |
|
Simple persistent storage for Python objects (dict-like API). |
2.0 |
|
Parse shell-like syntaxes into tokens. |
2.0 |
|
High-level file operations: copy, move, archive, disk usage. |
2.0 |
|
Set handlers for asynchronous signals. |
2.0 |
|
Site-specific configuration hook that runs at startup. |
2.0 |
|
Send emails using the SMTP protocol. |
2.0 |
|
Low-level networking interface. |
2.0 |
|
Framework for network servers (TCP/UDP). |
3.0 |
|
Built-in lightweight SQL database (SQLite). |
2.5 |
|
TLS/SSL wrapper for secure network connections. |
2.6 |
|
Constants and helpers for interpreting os.stat() results. |
2.0 |
|
Basic statistics (mean, median, stdev). |
3.4 |
|
Common string constants and helpers. |
2.0 |
|
String preparation for internet protocols (IDNA). |
2.3 |
|
Convert between Python values and C structs packed as bytes. |
2.0 |
|
Spawn new processes and connect to their input/output/error pipes. |
2.4 |
|
Read and write Sun AU audio files. |
2.0 |
|
Access the compiler's internal symbol tables. |
2.6 |
|
Access to interpreter variables and functions. |
— |
|
Access Python's configuration information. |
3.2 |
T¶
Module |
Description |
Introduced |
|---|---|---|
Detect ambiguous indentation in Python source files. |
2.0 |
|
Read and write tar archives, including gzip/bz2/xz. |
2.3 |
|
Telnet client implementation. |
2.0 |
|
Create temporary files and directories safely. |
2.0 |
|
POSIX terminal control (Unix). |
2.0 |
|
Regression tests package for the Python standard library. |
2.0 |
|
Wrap and fill text paragraphs. |
2.3 |
|
Higher-level threading interface (locks, events, threads). |
2.0 |
|
Time access and conversions. |
— |
|
Measure execution time of small code snippets. |
2.3 |
|
Standard GUI toolkit (Tk interface) package. |
3.0 |
|
Token constants used by the Python tokenizer. |
2.0 |
|
Turn Python source into tokens (lexical scanner). |
2.0 |
|
Read TOML files into Python data structures. |
3.11 |
|
Trace program execution and produce coverage reports. |
2.0 |
|
Print or retrieve stack traces. |
2.0 |
|
Track memory allocations to find leaks and hotspots. |
3.4 |
|
Terminal control functions (Unix). |
2.0 |
|
Simple graphics library for teaching and fun. |
2.5 |
|
Names for built-in types and helper factories. |
2.0 |
|
Type hints and typing helpers for static analysis and tooling. |
3.5 |
U¶
Module |
Description |
Introduced |
|---|---|---|
Access the Unicode Character Database (properties, normalization). |
2.0 |
|
Unit testing framework (xUnit style) for Python. |
2.1 |
|
Package for working with URLs (requests, parsing, robots). |
2.0 |
|
Generate universally unique identifiers (UUIDs). |
2.5 |
V¶
Module |
Description |
Introduced |
|---|---|---|
Create lightweight isolated Python environments. |
3.3 |
W¶
Module |
Description |
Introduced |
|---|---|---|
Issue and control warning messages. |
2.0 |
|
Read and write WAV audio files. |
2.0 |
|
Weak references to objects (avoid reference cycles). |
2.0 |
|
Open URLs in a web browser. |
2.0 |
|
WSGI utilities and simple reference server for web apps. |
2.3 |
X¶
Module |
Description |
Introduced |
|---|---|---|
Pack and unpack XDR data (External Data Representation). |
2.0 |
|
XML processing package. |
2.0 |
|
XML-RPC client and server package. |
2.2 |
Z¶
Module |
Description |
Introduced |
|---|---|---|
Create executable Python zip applications. |
3.5 |
|
Read and write ZIP archives. |
2.0 |
|
Import modules from ZIP archives. |
2.3 |
|
Compress and decompress data using zlib. |
2.0 |
|
IANA time zone support for datetime. |
3.9 |
Catatan
This page lists Python 3.13 Standard Library modules. Some modules are platform-specific (Unix/Windows) or optional at build time.