distinfo
is a library for extracting metadata from Python distributions.
It includes standard metadata per Python Metadata 2.1 plus an extra attribute, "ext", for extended metadata. Metadata is collected from:
- parsing of pyproject.toml, if dynamic also by calling PEP517 hook "prepare_metadata_for_build_wheel"
- execution of the setup.py script
- dist and egg info directories
Print requirements and metadata:
>>> import distinfo
>>>
>>> dist = await distinfo.from_path("/path/to/package/source")
>>> distinfo.dump(dist)
author_email:
- A N Other <ano@example.org>
classifier:
- 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)'
- 'Operating System :: POSIX'
- 'Programming Language :: Python :: 3'
ext:
build_backend: flit_core.buildapi
collectors:
PathMetadata: false
PyProjectMetadata: true
format: pyproject
packages:
- example
path: /path/to/package/source
scripts:
example: example.cli:main
tests:
- tests
home_page: https://example.org
license: GPL-3.0-or-later
metadata_version: '2.1'
name: example
requires:
build_system_requires:
- flit-core<4,>=3.2
dev:
- pycmd
run:
- click
- requests
test:
- pytest
requires_python: '>=3.10'
summary: Example project
version: 1.0.0
Cli output (yaml):
$ distinfo /path/to/package/source
Cli specify format:
$ distinfo -f [json|msgpack] /path/to/package/source
https://packaging.python.org/specifications/
- Core Metadata
- PEP 241 - Metadata for Python Software Packages 1.0
- PEP 314 - Metadata for Python Software Packages 1.1
- PEP 345 - Metadata for Python Software Packages 1.2
- PEP 517 - A build-system independent format for source trees
- PEP 518 - Specifying Minimum Build System Requirements for Python Projects
- PEP 566 - Metadata for Python Software Packages 2.1
- PEP 621 - Storing project metadata in pyproject.toml
- PEP 426 - Metadata for Python Software Packages 2.0 (withdrawn)
- PEP 459 -- Standard Metadata Extensions for Python Software Packages (withdrawn)