Registry / type-stubs / stdlib-list

stdlib-list

JSON →
library0.12.0pypypi✓ verified 24d ago

A Python library that provides lists of all standard library modules for various Python versions (currently 2.7 through 3.14). It is actively maintained with updates for new Python releases. This library is particularly useful for static analysis and tooling that needs to differentiate between standard library and third-party modules. For Python 3.10 and newer, `sys.stdlib_module_names` offers similar functionality.

pip install stdlib-list
INSTALL
IMPORT
SIG · STDLIB-LIST
S
stdlib-list
type-stubspythonv0.12.0
Install
1.6s avg
Import
18ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.12.0 · 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.018s · 18.1MB
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.

stdlib_list
from stdlib_list import stdlib_list

This example demonstrates how to import `stdlib_list` and retrieve the list of standard library modules for a specific Python version, or for the latest version supported by the package.

from stdlib_list import stdlib_list # Get a list of standard library modules for Python 3.9 libraries_3_9 = stdlib_list("3.9") print(f"Python 3.9 stdlib modules (first 5): {libraries_3_9[:5]}") # Get a list for the latest supported Python version (e.g., 3.14 in v0.12.0) libraries_latest = stdlib_list("3.14") print(f"Python 3.14 stdlib modules (first 5): {libraries_latest[:5]}") # Check if a module is in the standard library for a specific version is_os_in_3_9 = "os" in libraries_3_9 print(f"'os' in Python 3.9 stdlib: {is_os_in_3_9}")
Debug
Known issues
gotchaFor Python 3.10 and newer, Python's built-in `sys.stdlib_module_names` and `sys.builtin_module_names` provide similar functionality to identify standard library modules. This library might be redundant for such environments if only the currently running Python's stdlib list is needed.
fix
Consider using `sys.stdlib_module_names` or `sys.builtin_module_names` for newer Python versions.
affects: Python >= 3.10
breakingSupport for Python 3.7 and 3.8 was dropped starting from `stdlib-list` version 0.11.0. Users on these Python versions will need to use an older `stdlib-list` version.
fix
Upgrade your Python environment to 3.9+ or pin `stdlib-list` to a version older than 0.11.0 (e.g., `stdlib-list==0.10.0`).
affects: stdlib-list >= 0.11.0 on Python 3.7, 3.8
deprecatedThe `types-stdlib-list` package is a separate type stub package that becomes unnecessary for `stdlib-list` versions 0.9.0 and newer, as type annotations are now included directly in the main library.
fix
Uninstall `types-stdlib-list` if your `stdlib-list` version is 0.9.0 or greater to avoid potential conflicts or redundant dependencies.
affects: stdlib-list >= 0.9.0 (when `types-stdlib-list` is also installed)
gotchaThe `stdlib-list` project was originally archived by its creator after version 0.8.0. It was subsequently transferred to the `pypi` organization and is now actively maintained by new contributors. While the transition was managed to ensure continuity, it's a historical note if referencing very old documentation or issues.
fix
Ensure you are referencing the official `pypi/stdlib-list` GitHub repository and PyPI page for the most up-to-date information and project status.
affects: All versions, particularly relevant for versions around and after 0.8.0.
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'stdlib_list'
The `stdlib-list` package has not been installed in the current Python environment.
fix
pip install stdlib-list
ValueError: Invalid Python version 'X.Y'. Must be one of ['2.7', '3.5', ..., '3.14']
The specified Python version for which to retrieve standard library modules is not supported by the `stdlib-list` library.
fix
from stdlib_list import stdlib_list
supported_versions = stdlib_list.get_supported_versions()
# Use one of the supported version strings, e.g., stdlib_list.get_stdlib_list('3.9')
TypeError: 'module' object is not callable
The `stdlib_list` object imported from the `stdlib_list` package is the module itself, containing the methods directly, and should not be treated as a class that needs instantiation.
fix
from stdlib_list import stdlib_list
# Call methods directly on the imported 'stdlib_list' object, without parentheses
python_38_stdlib = stdlib_list.get_stdlib_list('3.8')
Upgrade
Version history
0.12.0latest on PyPI · released Oct 24, 2025
Audit
Dependencies
pythonrequiredRuntime dependency for the library.
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
stdlib-list — pip install stdlib-list · libregistry