pyproject-parser is a Python library designed to parse and access data from 'pyproject.toml' files, adhering to PEP 517 and PEP 621 specifications. It simplifies programmatic access to project metadata, build system configurations, and other sections defined in 'pyproject.toml'. The library is actively maintained, with frequent releases, often including pre-releases (betas) before stable versions, and is currently at version 0.14.0.
pip install pyproject-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a 'pyproject.toml' file and access its project metadata using the `PyProject` class and its `from_path` method. It creates a temporary dummy 'pyproject.toml' to ensure the example is runnable.
Review the `CHANGELOG.rst` for detailed changes. Adapt code to use the new `PyProject` constructor signature and access metadata via `project.name`, `project.version`, etc. instead of deprecated properties.
Update calls from `PyProject.from_path(path=some_path)` to `PyProject.from_path(filename=some_path)`.
Replace usage of `parse()` or `load()` with `PyProject.from_path()` or `PyProject.from_string()`.
Change `project.project_name` to `project.name`.
Update the call to use `PyProject.from_path(filename=my_path)` instead of `PyProject.from_path(path=my_path)`.
Refactor code to use `PyProject.from_path()` for file parsing or `PyProject.from_string()` for string content.