Python importlib.metadata: accessing package metadata
Answer: importlib.metadata reads metadata from an installed distribution package.
What you can look up
The library can report entry points and top-level import package names.
It is built in part on Python's import system.
These APIs were previously exposed by the now-removed pkg_resources package.
Together with importlib.resources, it supersedes pkg_resources.
Where it looks and when it arrived
It operates on third-party distribution packages installed into site-packages, for example with pip.
It works with discoverable dist-info or egg-info directories and Core metadata.
The module was added in version 3.8.
In version 3.10 it is no longer provisional.
See also
Claims
- id: C1 claim: importlib.metadata provides access to metadata of an installed distribution. source: S1 evidence: "importlib.metadata is a library that provides access to the metadata of an installed"
- id: C2 claim: importlib.metadata is no longer provisional. source: S1 evidence: "importlib.metadata is no longer provisional."
- id: C3 claim: Along with importlib.resources, it supersedes pkg_resources. source: S1 evidence: "Along with importlib.resources , it supersedes pkg_resources ."
- id: C4 claim: The module was added in version 3.8. source: S2 evidence: "versionadded:: 3.8"
Sources
- [S1] importlib.metadata – Accessing package metadata. Python Software Foundation. https://docs.python.org/3/library/importlib.metadata.html . License: PSF License Version 2. Accessed 2026-11-24.
- [S2] importlib.metadata documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/importlib.metadata.rst . License: PSF License Version 2. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, importlib.metadata – Accessing package metadata; CPython, importlib.metadata documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, importlib.metadata – Accessing package metadata; CPython, importlib.metadata documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.
Cite this
iinventedlight. 2026. "Python importlib.metadata: accessing package metadata." iinventedlight Library, iil:note:qbw4cc6d, version of 2026-11-24. https://iinventedlight.com/library/notes/python-importlib-metadata/. License: CC-BY-4.0.
@misc{iil_note_qbw4cc6d,
author = {{iinventedlight}},
title = {{Python importlib.metadata: accessing package metadata}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/python-importlib-metadata/},
note = {Permanent ID iil:note:qbw4cc6d. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- python-importlib-metadata.schema.json (schema; CC-BY-4.0)
- python-importlib-metadata.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-importlib-metadata.md.