Python Standard Library List

0.12.0 · active · verified Fri Apr 10

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.

Warnings

Install

Imports

Quickstart

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}")

view raw JSON →