Registry / testing / stdlibs

stdlibs

JSON →
library2026.2.26pypypi✓ verified 24d ago

The `stdlibs` Python package (also known as `stdlib-list` on GitHub) provides a static, programmatic listing of modules in the Python standard library. It offers lists for various Python major releases, dating back to Python 2.3, and combined lists for all 3.x or 2.x modules. This package is primarily used by tools for static analysis, linting, and other applications that need an authoritative, historical record of standard library module names. As of version 2026.2.26, it continues to track changes in the CPython standard library and appears to follow a date-based release cadence, indicating active maintenance.

pip install stdlibs
INSTALL
IMPORT
SIG · STDLIBS
S
stdlibs
testingpythonv2026.2.26
Install
1.6s avg
Import
13ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2026.2.26 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.014s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

module_names
import stdlibs print(stdlibs.module_names)
Access the comprehensive list of Python 3.x standard library module names.
py_module_names
import stdlibs print(stdlibs.py310)
Access a version-specific list of module names (e.g., for Python 3.10).

Demonstrates how to import the `stdlibs` package and access its various lists of standard library module names for different Python versions. The primary attributes are `module_names` (a superset of 3.x modules) and `pyXX` for specific Python versions (e.g., `py310`).

import stdlibs # Get a list of all module names ever available in Python 3.x all_py3_modules = stdlibs.py3_all print(f"Total Python 3.x modules recorded: {len(all_py3_modules)}") # Get the list of modules for a specific Python version (e.g., Python 3.9) py39_modules = stdlibs.py39 print(f"Python 3.9 modules: {py39_modules[:5]}...") # Check if a module exists in a specific version is_asyncio_in_py34 = 'asyncio' in stdlibs.py34 print(f"Is 'asyncio' in Python 3.4 stdlib? {is_asyncio_in_py34}")
Debug
Known issues
gotchaFor Python 3.10 and newer, the built-in `sys.stdlib_module_names` attribute provides a list of standard library modules for the *currently running* interpreter. The `stdlibs` package remains valuable for historical data, cross-version analysis, or pre-release listings, but might be redundant for simple runtime introspection on newer Python versions.
fix
Consider using `sys.stdlib_module_names` directly for the current runtime if historical or cross-version data is not needed. Otherwise, continue using `stdlibs` for its comprehensive static listings.
affects: Python >=3.10
breakingThe actual Python standard library is dynamic across major versions. Python 3.11, 3.12, and 3.13 notably removed many legacy modules (e.g., those specified in PEP 594). The `stdlibs` package accurately reflects these removals in its version-specific lists (e.g., `stdlibs.py313` will not contain removed modules). Developers performing static analysis across Python versions must account for these module deprecations and removals, as code relying on removed modules will break in newer environments.
fix
When targeting newer Python versions, consult the relevant `stdlibs.pyXX` list to verify module availability. If a module has been removed, migrate to external alternatives or re-implement necessary functionality.
affects: Python >=3.11 (referring to the standard library itself)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'stdlib-list'
The package name on PyPI is `stdlib-list`, but the actual importable module name in Python is `stdlibs`.
fix
Use `import stdlibs` instead of `import stdlib-list`.
TypeError: 'list' object is not callable
You are attempting to call `stdlibs.py3` (or similar version attributes) as if it were a function, but it is a direct list attribute.
fix
Access the list directly without parentheses, e.g., `my_list = stdlibs.py3`.
TypeError: 'function' object is not iterable
You are attempting to iterate over the function object `stdlibs.get_stdlib_list` itself without calling it, which returns the list of modules.
fix
Call the function with parentheses to get the list, e.g., `for module_name in stdlibs.get_stdlib_list():`.
ValueError: Invalid version format: 'x.y.z'. Expected formats like '3.9', '3', or None for combined list.
The `get_stdlib_list` function was called with a version string that does not match the expected 'MAJOR.MINOR' or 'MAJOR' format (e.g., '3.9' or '3').
fix
Provide the version in the correct format, such as `stdlibs.get_stdlib_list(version='3.9')` or `stdlibs.get_stdlib_list(version='3')`.
Upgrade
Version history
2026.2.26latest on PyPI · released Feb 26, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Resources
stdlibs — pip install stdlibs · libregistry