Skip to main content

List of packages in the stdlib

Project description

stdlibs

Simple list of top-level packages in Python's stdlib

license version changelog documentation

This package provides a static listing of all known modules in the Python standard library, with separate lists available for each major release dating back to Python 2.3. It also includes combined lists of all module names that were ever available in any 3.x release, any 2.x release, or both.

Note: On Python versions 3.10 or newer, a list of module names for the active runtime is available sys.stdlib_module_names. This package exists to provide an historical record for use with static analysis and other tooling.

This package only includes listings for CPython releases. If other runtimes would be useful, open an issue and start a discussion on how best that can be accomodated.

Install

You can install it from PyPI:

$ pip install stdlibs

Usage

The recommended usage is to reference stdlibs.module_names — the top-level names that are valid in some version of Python 3.x on some platform. This is a superset of top-level names you may have, and a superset of those in sys.stdlib_module_names.

>>> from stdlibs import module_names
>>> print("os" in module_names)
True
>>> print("peg_parser" in module_names)  # 3.9+
True

If you need a specific version, those are available as other modules:

>>> from stdlibs.py36 import module_names as module_names_py36
>>> print("os" in module_names_py36)
True
>>> print("peg_parser" in module_names_py36)
False

If you intend to process more than one version, you may find the string api easier:

>>> from stdlibs import stdlib_module_names, KNOWN_VERSIONS
>>> [v for v in KNOWN_VERSIONS if "dataclasses" in stdlib_module_names(v)]
['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
>>>
>>> sorted(stdlib_module_names("3.7") - stdlib_module_names("3.6"))
['_abc', '_contextvars', '_py_abc', '_queue', '_uuid', '_xxtestfuzz', 'contextvars', 'dataclasses']
>>>
>>> from moreorless.click import unified_diff
>>> prev = None
>>> buf = []
>>> for v in KNOWN_VERSIONS:
...     cur = ''.join([f"{name}\n" for name in sorted(stdlib_module_names(v))])
...     if prev:
...         buf.append(unified_diff(prev, cur, f"new-in-{v}"))
...     prev = cur
>>> print(''.join(''.join(buf).splitlines(True)[:10]), end='')
--- a/new-in-2.4
+++ b/new-in-2.4
@@ -19,7 +19,6 @@
 DocXMLRPCServer
 ERRNO
 EasyDialogs
-FCNTL
 FILE
 FL
 FileDialog

Regenerating

Add or update the list of releases and download URLs in stdlibs/fetch.py, then execute the stdlibs.fetch module:

$ make distclean virtualenv
$ source .venv/bin/activate
(.venv) $ python -m stdlibs.fetch

License

stdlibs is copyright Amethyst Reese, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stdlibs-2023.12.15.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

stdlibs-2023.12.15-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file stdlibs-2023.12.15.tar.gz.

File metadata

  • Download URL: stdlibs-2023.12.15.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for stdlibs-2023.12.15.tar.gz
Algorithm Hash digest
SHA256 c2041f2a133773e234205d72f48980aebbecec47b17206dd9679747581ae8372
MD5 937166b6189a8c6a7d87fcfbeeaf16b1
BLAKE2b-256 41ad3a641e3eca825ba2d3425039fa04839610f6c21c819b6a86bcb49088c007

See more details on using hashes here.

File details

Details for the file stdlibs-2023.12.15-py3-none-any.whl.

File metadata

File hashes

Hashes for stdlibs-2023.12.15-py3-none-any.whl
Algorithm Hash digest
SHA256 190f2cb01b68fa8c5aa599f04e925228d55db57f618262e58f581076ad2aa7b6
MD5 4904aee20d33804fa589f185c00382a1
BLAKE2b-256 7559813bcdf1cca0b596d3d80f085f381b478d3531c8a83055e2ac162373150f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page