pyproject-toml is a Python library designed to parse and manage `pyproject.toml` files according to various PEPs, including PEP 517, 518, 621, and 631. It provides a structured way to access project metadata and build system configuration. The current version is 0.1.0, and it follows an infrequent release cadence based on new PEP implementations or bug fixes.
pip install pyproject-tomlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically create a dummy `pyproject.toml` file, load it using `PyProjectTOML`, and access common project metadata like name and version. The example cleans up the created file afterwards.
Always use `from pyproject_toml import PyProjectTOML` (with an underscore) in your Python code.
Explicitly specify the path to your `pyproject.toml` file using `PyProjectTOML(filename='/path/to/pyproject.toml').load()` or ensure your script's working directory is correct.
It is recommended to pin the exact library version (e.g., `pyproject-toml==0.1.0`) in your `requirements.txt` or `pyproject.toml` and carefully review changelogs when upgrading to new versions.