Metadata Utilities
Utilities for reading, writing, and validating pyproject.toml metadata.
- pypreset.metadata_utils.read_pyproject_metadata(project_dir)[source]
Read metadata from an existing pyproject.toml.
Returns a flat dict with keys matching the Metadata model fields. Works with both Poetry ([tool.poetry]) and PEP 621 ([project]) layouts.
- pypreset.metadata_utils.set_pyproject_metadata(project_dir, updates, *, overwrite=False)[source]
Update metadata fields in an existing pyproject.toml.
- Parameters:
- Return type:
- Returns:
List of warnings about fields that remain empty.
- pypreset.metadata_utils.check_publish_readiness(data)[source]
Check if metadata is sufficient for PyPI publishing.
Returns a list of warning strings for empty/default fields.