Registry / serialization / pyproject-parser

pyproject-parser

JSON →
library0.14.0pypypi✓ verified 89d ago

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-parser
INSTALL
IMPORT
SIG · PYPROJECT-PARSER
P
pyproject-parser
serializationpythonv0.14.0
Install
2.6s avg
Import
395ms
Disk
22MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.14.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.413s · 23.9MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 2.6s · import 0.378s · 24MB
22MB installed
● package 22MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PyProject
✓ from pyproject_parser import PyProject
✗ from pyproject_parser.parser import PyProject
The primary class for parsing is now directly exposed in the top-level package.

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.

from pyproject_parser import PyProject from pathlib import Path # Create a dummy pyproject.toml for demonstration dummy_toml_content = ''' [project] name = "my-awesome-project" version = "0.1.0" authors = [ {name = "John Doe", email = "john@example.com"} ] description = "A minimal project" readme = "README.md" requires-python = ">=3.8" keywords = ["python", "example"] classifiers = [ "Programming Language :: Python :: 3" ] [build-system] requires = ["setuptools>=61.0.0", "wheel"] build-backend = "setuptools.build_meta" ''' dummy_toml_path = Path("dummy_pyproject.toml") dummy_toml_path.write_text(dummy_toml_content) try: project = PyProject.from_path(dummy_toml_path) print(f"Project Name: {project.name}") print(f"Project Version: {project.version}") print(f"Required Python: {project.requires_python}") if project.authors: print(f"Author: {project.authors[0].name} <{project.authors[0].email}>") finally: # Clean up the dummy file dummy_toml_path.unlink()
Debug
Known issues
breakingMajor API overhaul in versions 0.9.0 and 0.10.0 introduced significant breaking changes to the PyProject class's constructor and property names (e.g., `project_name` was renamed to `name`, `project` property removed).
fix
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.
affects: 0.9.0, 0.10.0
breakingThe `PyProject.from_path()` method's `path` argument was renamed to `filename` in version 0.10.0.
fix
Update calls from `PyProject.from_path(path=some_path)` to `PyProject.from_path(filename=some_path)`.
affects: 0.10.0
breakingThe top-level `parse` and `load` helper functions (e.g., `from pyproject_parser import parse`) were removed in version 0.12.0.
fix
Replace usage of `parse()` or `load()` with `PyProject.from_path()` or `PyProject.from_string()`.
affects: 0.12.0
Errors
Common errors & fixes
AttributeError: 'PyProject' object has no attribute 'project_name'
In versions 0.10.0 and later, the `project_name` property was removed and replaced by the `name` property to align with PEP 621.
fix
Change `project.project_name` to `project.name`.
TypeError: PyProject.from_path() got an unexpected keyword argument 'path'
The argument for specifying the TOML file path was renamed from `path` to `filename` in version 0.10.0.
fix
Update the call to use `PyProject.from_path(filename=my_path)` instead of `PyProject.from_path(path=my_path)`.
ImportError: cannot import name 'parse' from 'pyproject_parser'
The standalone `parse` and `load` helper functions were removed in version 0.12.0, consolidating parsing functionality into the `PyProject` class.
fix
Refactor code to use `PyProject.from_path()` for file parsing or `PyProject.from_string()` for string content.
Upgrade
Version history
0.14.0latest on PyPI · released Dec 11, 2025
Audit
Dependencies
tomlkitrequiredCore dependency for TOML parsing.
Agent activity
25 hits · last 30 days
node
12
Resources
pyproject-parser — pip install pyproject-parser · libregistry