← All notes

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

Sources

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

Permanent ID: iil:note:qbw4cc6d

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.},
}

Markdown

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.

All artifact files (JSON index)

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.