# pyproject.toml explainer

> Paste a pyproject.toml and read it table by table and key by key: what each key is for, the core metadata field it fills, every dependency taken apart, and the rules of the packaging specifications it breaks, each marked error, warning or note.

- Tool: https://ronutz.com/en/tools/pyproject-toml-explainer
- Family: Operations & Fieldcraft

---

## What it does

Paste a `pyproject.toml` and the tool reads it with its own TOML parser, then explains it table by table and key by key: what each key of `[build-system]`, `[project]`, `[dependency-groups]` and `[tool]` is for, the core metadata field it fills, and what the engine read from its value. Every dependency is taken apart (name, extras, each version clause in words, the URL of a direct reference, the environment marker and the type of each marker field); the version is normalized; the licence expression is checked against the SPDX License List and given in canonical case; the readme's content type, the people and the fields they fill, URL labels and the well-known ones, entry points, extras, dependency group includes and each tool's keys are listed. Then it checks the file against the specifications and reports each finding with its line, its key and its strength. Everything runs in your browser, and nothing the file names (a URL, a readme, a licence file, a build requirement) is opened, fetched or installed.

It sits beside the [wheel filename explainer](https://ronutz.com/en/tools/wheel-filename-explainer), which reads the file names a build produces, and the [Python playground](https://ronutz.com/en/tools/python-playground).

## Error, warning, note

Each finding carries the strength of the rule behind it, read from the specification's own words:

- **Error**: the specification says MUST or MUST NOT (or the file is not TOML, or a value has the wrong TOML type). Examples: a `[project]` table without `name`; `name` listed in `dynamic`; a key that is not one of the keys `[project]` defines; a static key also listed in `dynamic` when it is not one of the list or table keys a back-end may extend; a `readme` table with both `file` and `text`; a `console_scripts` group under `[project.entry-points]`; an import name in both `import-names` and `import-namespaces`; a cycle of dependency group includes.
- **Warning**: SHOULD or SHOULD NOT, something the specification says a tool MAY refuse, something deprecated, or TOML 1.1.0 syntax. Examples: a version that is not in normal form; a `License ::` classifier (deprecated by PEP 639); a licence expression together with `License ::` classifiers; `extra != "..."` in a marker; an ordered comparison on a string marker field; an `==` pin; a direct reference without a secure transport or a hash.
- **Note**: worth knowing, nothing to fix. Examples: no `[build-system]` table, so the setuptools defaults apply; a key both static and dynamic that PEP 808 allows; a licence expression accepted but not in the list's case; a self-referential extra.

## What it checks

- **The tables.** Only `[build-system]`, `[project]`, `[dependency-groups]` and `[tool]` are defined; the specification reserves every other top-level table for future use (warning).
- **`[build-system]`.** `requires` is mandatory in the table and each string is a dependency specifier; `build-backend` is an object reference, `module` or `module:object`, with dotted Python identifiers and no spaces (PEP 517); each `backend-path` directory stays inside the source tree. Without `build-backend`, front-ends fall back to the legacy setuptools behaviour (note); without the table, the defaults `requires = ["setuptools"]` apply (note).
- **`[project]`.** Every key's TOML type and its core metadata field. `name` is a valid project name, never dynamic, compared normalized. `version` is a PEP 440 version, given or listed in `dynamic`. `description` is one line (tools MAY error). `readme` is a path ending in `.md` or `.rst`, or a table with exactly one of `file` and `text` and a `content-type` of `text/plain`, `text/x-rst` or `text/markdown`, charset UTF-8, Markdown variant `GFM` or `CommonMark`. `requires-python` is a version specifier set. `license` is an SPDX licence expression (the table form is deprecated, and `file` and `text` are mutually exclusive); `license-files` holds glob patterns that stay inside the project (no `..`, no absolute path, only the characters the glob specification allows) and an empty array means no licence files. `authors` and `maintainers` are tables with `name`, `email` or both, a name without commas. `urls` labels are at most 32 characters. `scripts`, `gui-scripts` and `entry-points` hold object references, with entry point groups one level deep and no `console_scripts` or `gui_scripts` group under `entry-points`. `optional-dependencies` keys are valid extra names, in the normalized form core metadata requires, with no two the same once normalized. `import-names` and `import-namespaces` (PEP 794) hold dotted identifiers with an optional `; private`, `import-namespaces` is never empty, and no name is in both. `dynamic` lists only `[project]` keys, never `name`.
- **`dynamic` and PEP 808.** Since May 2026, a list or table key (`authors`, `classifiers`, `dependencies`, `entry-points`, `gui-scripts`, `import-names`, `import-namespaces`, `keywords`, `license-files`, `maintainers`, `optional-dependencies`, `scripts`, `urls`) may be given and also listed in `dynamic`: the back-end may add entries but must not change or remove the ones given (note). Any other key given statically and listed in `dynamic` is an error.
- **Dependency specifiers.** The grammar of the dependency specifiers specification: the name, extras, version clauses (with every PEP 440 rule the wheel filename explainer applies), direct references after `@`, and environment markers with `and`, `or` and parentheses. The marker comparison rules: an ordered comparison or `~=` and `===` on a string field, `in` on a version field, a constant that is not a version on a version field, `extras` and `dependency_groups` outside a lock file, `extra !=` and other operators on `extra`, comparisons between two constants, and the old spellings such as `os.name`. A direct reference should use a secure transport and carry a hash; a `;` written straight after a URL belongs to the URL, so the marker that seems to follow it is not one.
- **Dependency groups** (PEP 735). Group names are valid names compared normalized (duplicates after normalization: warning, as tools SHOULD emit an error); each item is a dependency specifier or a table with exactly one key, `include-group`; includes name existing groups and never form a cycle; a group named like an extra is advised against.
- **`[tool]`.** Each tool keeps its settings in a sub-table named after the project that owns that name on PyPI; the tool lists each one's keys and their TOML types.

## The TOML parser

The tool has its own TOML parser. It implements the whole of TOML 1.0.0: basic, literal and multi-line strings with every escape, integers in four bases (with values beyond 64 bits kept exact), floats including `inf` and `nan`, booleans, the four date and time types with range checks, arrays, inline tables, standard tables, arrays of tables, dotted keys, and every rule about defining a table or a key twice. Where the TOML text leaves room, it does what Python's `tomllib` does: a byte order mark at the start is refused, a DEL character in a comment is refused, and a 60th second is refused.

If the file is not TOML 1.0.0, the parser tries TOML 1.1.0 (released 2025-12-18): new lines and a trailing comma inside inline tables, the `\x` and `\e` escapes, and times without seconds. A file that needs 1.1.0 is explained with a warning naming the features and the first line, because Python's `tomllib` reads TOML 1.1.0 only from Python 3.15; in Python 3.11 to 3.14 it reads 1.0.0, so tools built on those versions refuse the file. Nested arrays and inline tables are limited to 100 levels and a dotted key to 128 parts, and the file to 500,000 characters.

## What it does not check

- **Files named in the file.** Whether `README.md` exists, is UTF-8 or renders; whether the licence files match anything; whether `backend-path` resolves inside the tree through symbolic links. Nothing is read from disk or the network.
- **The build back-end's own rules**, and any key a back-end requires under `[tool]`. The tool lists those keys but has no schema for them.
- **Classifiers against PyPI's list**, and whether a name is taken on PyPI.
- **Email addresses** beyond their basic shape (one `@` with text on both sides, a dot in the domain, no spaces, angle brackets or commas), so an address that fails is a warning rather than an error.
- **`Requires-Python` against the dependencies**, or whether the dependencies can be resolved together.

## Where it follows the reference implementations

During development the TOML parser was compared with `tomllib` from CPython 3.13.16 (TOML 1.0.0) and `tomli` 2.5.0 (TOML 1.1.0) on 90,137 generated documents, values and verdicts both, with no disagreement. The dependency specifier parser was compared with packaging 26.3 on 60,000 strings: it agrees except where packaging departs from the grammar, and there it follows the grammar (673 cases): empty parentheses with no version clause and `===` without a version are refused, and a `===` clause followed by a comma ends at the comma, where packaging reads the comma into the arbitrary version. The licence check was compared with packaging 26.3's `canonicalize_license_expression` on 20,000 expressions and agreed on every one. It departs by design in one case: a lower-case `licenseref-` prefix, which the SPDX annex calls invalid and packaging accepts, is refused here. Like packaging, it refuses the `DocumentRef-` and `AdditionRef-` forms, which the packaging specification does not list.

## Worked examples

- **The Example button**: a `netcheck` project built with hatchling. Five warnings: a licence expression together with a `License ::` classifier, that deprecated classifier, an `==` pin on `cryptography`, `os_name > 'nt'` (an ordered comparison on a string field), and the extra `Dev_Tools` not in the normalized form core metadata requires. Three notes: `"mit"` is valid and canonically `MIT`; `dependencies` is both given and dynamic, which PEP 808 allows; `netcheck[test]` is a self-referential extra.
- A file whose `[project]` has neither `name` nor `version` gets two errors; with `dynamic = ["version"]` only the first remains.
- `[project]` then `name = "a"` then `name = "b"` is not TOML: the key `project.name` is defined twice, at line 3, column 1.

## Provenance

The engine is pure: one pass per value, no clock, no network, no randomness, no regular expression with nested quantifiers. It ships golden vectors (set `pyproject-toml-explainer/2026-10-27a`): 96 rows, of which 36 TOML documents (the TOML 1.0.0 page's own valid and invalid examples among them) whose values and errors come from `tomllib` and `tomli`, 24 dependency specifiers and 16 licence expressions with packaging 26.3's verdicts, and 20 whole files with every expected finding, line and severity.

## API

The same engine answers the `/api/v1/pyproject-toml-explainer` operation of the site's HTTP API, described in the OpenAPI contract on the [API page](https://ronutz.com/en/api); the contract also says whether this site serves the API.

- **Request.** The `pyproject.toml` text, in the body of a POST or in the `input` query parameter of a GET.
- **Response.** `status` (`ok`, `toml-error`, `too-long` or `empty`); `toml` (the grammar the file needed, `1.0.0` or `1.1.0`, the 1.1.0 features used and whether the file had CRLF line ends); `tomlError` (`code`, `line`, `col`, `key`) when the file is not TOML; `sections`, each with its `items` (`path`, `key`, `line`, `type`, `known`, `coreField`, `display`, `dynamic`, and the parsed `version`, `specifier`, `requirements`, `entries`, `urls`, `people`, `license`, `readme`, `keys`, `extras`, `group` or `reference` where they apply); `findings` (`code`, `severity`, `path`, `line`, `params`), errors first; `counts`; and `summary`. A file with findings is a normal answer, not an HTTP error.

## Share results

Under the headline facts (or under a TOML error, which is the reading too), **Share results** builds a link to this page, only when you press it, that carries after the `#` a copy of the file in which every credential of an http or https URL is replaced by eight bullets. A private index's URL often holds its credentials: pip reads `https://username:password@pypi.company.com/simple`, and a single-part token "as the "username"" with no password ([pip, Authentication](https://pip.pypa.io/en/stable/topics/authentication/)); uv embeds them the same way in a `[[tool.uv.index]]` `url` ([uv, Package indexes](https://docs.astral.sh/uv/concepts/indexes/)); a direct reference `name @ https://...` ([PEP 508](https://peps.python.org/pep-0508/)) can carry them too; all read 2026-11-01. So a password after the user name goes, and so does a lone user name, which may be a token; an ssh URL's user (`git+ssh://git@...`) is a login name and stays. The page never needs them: its findings read a URL's scheme, host, path and hash, never what comes before the `@`, and the copy must give the same findings, or no link is offered. Its popover says first what the link carries, then offers Copy link and, where the browser has one, its share sheet; the page's address is not changed. It also says how many credentials the copy replaced. A project file can name private indexes, internal URLs and people, so the popover asks you to read it before you send the link.

A TOML string may spell a character as `\u0040`; written in a URL, such an escape could hide the `@` from any search, so a line that holds both a URL and a `\u` or `\U` escape gets no link. Then the copy is searched for any other credential a standard defines (a PEM private key, an `Authorization` line, a JWT, an AWS access key ID, a FortiOS `ENC` value): one means no link, and the popover names its line. A key whose name only looks like a secret (`token = ...` in a `[tool]` table) does not block the link; the popover names the first one.

[RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) (section 3.5, read 2026-11-01) has the fragment "separated from the rest of the URI prior to a dereference", so what follows the `#` is not sent to the server when the link is opened; it stays in the address bar and the history of whoever opens it, and anyone who has the link can read it.

- **How long.** At most 16,384 characters in all, the bound the site uses for every value after the `#`; a longer share gets no link, and the popover says how long it is.
- **Opening a link.** The copy fills the box as a paste would and the page explains it, locally: no URL is fetched and no back-end is imported. The values then leave the page's address at once, without a request, so a reload or the page's own Share button carries nothing.

## Sources

All read 2026-10-27.

- [Python Packaging User Guide: pyproject.toml specification](https://packaging.python.org/en/latest/specifications/pyproject-toml/) (last updated Oct 27, 2026)
- [Python Packaging User Guide: Core metadata specifications](https://packaging.python.org/en/latest/specifications/core-metadata/) (version 2.6)
- [Python Packaging User Guide: Dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/) and [Version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/)
- [Python Packaging User Guide: Names and normalization](https://packaging.python.org/en/latest/specifications/name-normalization/), [Entry points](https://packaging.python.org/en/latest/specifications/entry-points/), [Dependency Groups](https://packaging.python.org/en/latest/specifications/dependency-groups/), [Well-known Project URLs](https://packaging.python.org/en/latest/specifications/well-known-project-urls/), [glob patterns](https://packaging.python.org/en/latest/specifications/glob-patterns/), [License Expression](https://packaging.python.org/en/latest/specifications/license-expression/)
- [SPDX Specification 3.0.1, Annex: SPDX License Expressions](https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/) and the [SPDX License List](https://spdx.org/licenses/) 3.29.0 of 2026-09-16
- [PEP 517](https://peps.python.org/pep-0517/), [PEP 518](https://peps.python.org/pep-0518/), [PEP 621](https://peps.python.org/pep-0621/), [PEP 639](https://peps.python.org/pep-0639/), [PEP 735](https://peps.python.org/pep-0735/), [PEP 794](https://peps.python.org/pep-0794/), [PEP 808](https://peps.python.org/pep-0808/)
- [TOML v1.0.0](https://toml.io/en/v1.0.0) and [TOML v1.1.0](https://toml.io/en/v1.1.0)
- [Python documentation: tomllib](https://docs.python.org/3/library/tomllib.html): TOML 1.0.0 from Python 3.11, TOML 1.1.0 from Python 3.15

## Standards and references

- [Python Packaging User Guide, pyproject.toml specification](https://packaging.python.org/en/latest/specifications/pyproject-toml/) - the tables; [build-system]; every [project] key, its type, its core metadata field and its rules; dynamic and the extensible keys (PEP 808); [tool]
- [Python Packaging User Guide, Core metadata specifications (version 2.6)](https://packaging.python.org/en/latest/specifications/core-metadata/) - Description-Content-Type, Project-URL (32-character labels), Provides-Extra, Import-Name, Dynamic
- [Python Packaging User Guide, Dependency specifiers (originally PEP 508)](https://packaging.python.org/en/latest/specifications/dependency-specifiers/) - the grammar, extras, environment markers, marker field types and comparison rules
- [Python Packaging User Guide, Version specifiers (originally PEP 440)](https://packaging.python.org/en/latest/specifications/version-specifiers/) - versions, the eight operators, direct references
- [Python Packaging User Guide, Names and normalization](https://packaging.python.org/en/latest/specifications/name-normalization/) - the name format and its normalized form
- [Python Packaging User Guide, Entry points specification](https://packaging.python.org/en/latest/specifications/entry-points/) - object references, group and entry point names, console_scripts and gui_scripts
- [Python Packaging User Guide, Dependency Groups (originally PEP 735)](https://packaging.python.org/en/latest/specifications/dependency-groups/) - [dependency-groups], includes, cycles
- [Python Packaging User Guide, Well-known Project URLs in Metadata](https://packaging.python.org/en/latest/specifications/well-known-project-urls/) - label normalization and the well-known labels
- [Python Packaging User Guide, glob patterns](https://packaging.python.org/en/latest/specifications/glob-patterns/) - the patterns license-files accepts
- [Python Packaging User Guide, License Expression](https://packaging.python.org/en/latest/specifications/license-expression/) - SPDX identifiers and LicenseRef-
- [SPDX Specification 3.0.1, Annex: SPDX License Expressions](https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/) - the expression grammar, operator precedence and case rules
- [SPDX License List 3.29.0 of 2026-09-16 (licenses.json and exceptions.json)](https://spdx.org/licenses/) - the licence and exception identifiers and which are deprecated
- [PEP 517, A build-system independent format for source trees (Final)](https://peps.python.org/pep-0517/) - build-backend, backend-path, the legacy setuptools behaviour
- [PEP 621, Storing project metadata in pyproject.toml (Final)](https://peps.python.org/pep-0621/) - the original [project] table
- [PEP 518, Specifying Minimum Build System Requirements for Python Projects (Final)](https://peps.python.org/pep-0518/) - the original [build-system] and [tool] tables
- [PEP 808, Including static values in dynamic metadata (Accepted)](https://peps.python.org/pep-0808/) - list and table keys both static and dynamic
- [PEP 794, Import Name Metadata (Accepted)](https://peps.python.org/pep-0794/) - import-names and import-namespaces
- [TOML v1.0.0 (toml.io) and its ABNF](https://toml.io/en/v1.0.0) - the whole language the parser implements
- [TOML v1.1.0 (toml.io), released 2025-12-18](https://toml.io/en/v1.1.0) - the four syntax additions the parser accepts with a warning
- [Python documentation (3.15), tomllib: TOML 1.1.0 from Python 3.15, 1.0.0 in 3.11 to 3.14](https://docs.python.org/3/library/tomllib.html) - which Python versions read TOML 1.1.0

## Related reading

- [Python environments and packaging: venv, pip, pyproject.toml, wheels and versions](https://ronutz.com/en/learn/python-environments-and-packaging.md): How a Python project gets its libraries without breaking the system's Python or the project next to it: what python -m venv builds and why a virtual environment is disposable and not movable, why python -m pip and why every environment carries its own pip (the October 2026 certificate incident shows it), why a distribution's Python refuses pip install (PEP 668), what sdists and wheels are and how to read a wheel's file name, what goes in pyproject.toml, how PEP 440 orders and matches versions, and where lock files fit. Every command was run on CPython 3.13.16.
- [Python supply-chain security: trusted publishing, attestations, hashes and lock files](https://ronutz.com/en/learn/python-supply-chain-security.md): What can go wrong between a maintainer's keyboard and your virtual environment, in the words of PyPI's own security documentation, and the controls that answer each case: names checked against an approved list, one index instead of two, pip's hash-checking mode, pylock.toml lock files, dependency cooldowns with --uploaded-prior-to, Trusted Publishing, PEP 740 attestations checked against a real wheel, and how PyPI handles malware reports, quarantine and yanked releases. Every command ran on CPython 3.13.16 with pip 26.2.1 against local test indexes.
