{"id":2790,"library":"stdlibs","title":"stdlibs: Python Standard Library Module Listing","description":"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.","status":"active","version":"2026.2.26","language":"en","source_language":"en","source_url":"https://github.com/omnilib/stdlibs","tags":["standard library","stdlib","module list","static analysis","tooling"],"install":[{"cmd":"pip install stdlibs","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Access the comprehensive list of Python 3.x standard library module names.","symbol":"module_names","correct":"import stdlibs\nprint(stdlibs.module_names)"},{"note":"Access a version-specific list of module names (e.g., for Python 3.10).","symbol":"py_module_names","correct":"import stdlibs\nprint(stdlibs.py310)"}],"quickstart":{"code":"import stdlibs\n\n# Get a list of all module names ever available in Python 3.x\nall_py3_modules = stdlibs.py3_all\nprint(f\"Total Python 3.x modules recorded: {len(all_py3_modules)}\")\n\n# Get the list of modules for a specific Python version (e.g., Python 3.9)\npy39_modules = stdlibs.py39\nprint(f\"Python 3.9 modules: {py39_modules[:5]}...\")\n\n# Check if a module exists in a specific version\nis_asyncio_in_py34 = 'asyncio' in stdlibs.py34\nprint(f\"Is 'asyncio' in Python 3.4 stdlib? {is_asyncio_in_py34}\")","lang":"python","description":"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`)."},"warnings":[{"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.","message":"For 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.","severity":"gotcha","affected_versions":"Python >=3.10"},{"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.","message":"The 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.","severity":"breaking","affected_versions":"Python >=3.11 (referring to the standard library itself)"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}