On this page
article
Read TOML Config
Load TOML with tomllib (3.11+).
Category: tomllib
Problem
Load TOML with tomllib (3.11+).
Solution
config = tomllib.loads(Path('pyproject.toml').read_text())
Notes
- Adapt variable names and paths to your project
- Add error handling for production use
- See related chapters in the Learning Path