--- id: pyproject-metadata version: "0.12.1" license: MIT license_treatment: permissive maintenance: active --- # pyproject-metadata — PEP 621 metadata parsing License: permissive · Maintenance: active · Downloads: 14.1M/mo ## What it is and what it does pyproject-metadata is a dataclass-based validator and transformer for Python project metadata. It takes a parsed dictionary representing the [project] table from pyproject.toml, validates it against PEP 621 and related standards, and generates RFC 822-formatted core metadata suitable for distribution (e.g., PKG-INFO files). It does not parse TOML itself—that responsibility stays with the caller—but handles all the structural validation, normalization, and serialization that build backends and packaging tools need. The package supports modern metadata standards including dynamic metadata (METADATA 2.2+), SPDX license expressions (METADATA 2.4+), and flexible error reporting. It can collect all validation errors at once rather than failing on the first one, making it useful for build systems that want to report comprehensive feedback. It also provides utilities to map between pyproject.toml field names and their corresponding metadata fields, and can validate classifiers against the trove_classifiers library if installed. Use it for: - Build backends (like hatchling or flit) validating and serializing project metadata during package builds. - Packaging tools that need to generate or inspect PKG-INFO files without re-parsing TOML. - CI/CD pipelines validating pyproject.toml metadata structure before publishing to PyPI. - Tools that need to convert between pyproject.toml [project] and core metadata formats programmatically. - Build systems implementing dynamic metadata, where some fields are computed at build time. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Validates and transforms pyproject.toml [project] metadata into PEP 643-compliant core metadata files (PKG-INFO) without parsing the TOML itself. Yes. This is a foundational tool for Python build backends and packaging infrastructure. It has no security vulnerabilities, minimal dependencies, active maintenance, and a permissive license. Install it if you're building a backend, validating project metadata, or need to generate core metadata files from structured data. ## Install pip install pyproject-metadata uv add pyproject-metadata poetry add pyproject-metadata ## Installing pyproject-metadata Before you install: Low friction: single runtime dependency (packaging), pure Python wheel, actively maintained with recent release. License in practice: MIT license permits unrestricted use, modification, and distribution in commercial and private projects. Quickstart: from pyproject_metadata import StandardMetadata parsed = {...} # dict from tomli or similar metadata = StandardMetadata.from_pyproject(parsed) pkg_info = metadata.as_rfc822() print(str(pkg_info)) Requires Python 3.8+; input must already be a parsed dict (TOML parsing is caller's responsibility). Verify before relying: - Whether SPDX license canonicalization (packaging 24.2+) is mandatory or optional for typical use. - Performance characteristics when processing large or deeply nested metadata structures. - Compatibility guarantees across future PEP 621 revisions beyond METADATA 2.4. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 14.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pyproject.toml metadata validation, PEP 621 metadata generation, core metadata PKG-INFO, project metadata dataclass, build backend metadata handling, RFC 822 metadata formatting, dynamic metadata support, build-backend, pep-621, metadata-validation [View on SkillFed](https://skillfed.io/packages/pyproject-metadata) · [View on PyPI](https://pypi.org/project/pyproject-metadata/)