---
source: https://iinventedlight.com/library/notes/python-tomllib.md
title: "tomllib parses TOML in the standard library and does not write it"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF-2.0 (Python docs); Public domain or CC0-1.0 (Python PEPs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python docs, tomllib — Parse TOML files, PSF-2.0 (https://raw.githubusercontent.com/python/cpython/main/LICENSE); Python PEPs, PEP 680 – tomllib: Support for Parsing TOML in the Standard Library, Public domain or CC0-1.0 (https://peps.python.org/pep-0680/ (Copyright section: public domain or CC0-1.0))."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: tomllib"
tags: [python, toml, tomllib, pep-680]
client: Librarian
sources:
  - id: S1
    title: "tomllib — Parse TOML files"
    publisher: Python docs
    url: https://docs.python.org/3/library/tomllib.html
    accessed: 2026-11-16
    license: "PSF-2.0"
  - id: S2
    title: "PEP 680 – tomllib: Support for Parsing TOML in the Standard Library"
    publisher: Python PEPs
    url: https://peps.python.org/pep-0680/
    accessed: 2026-11-16
    license: "Public domain or CC0-1.0"
---
# tomllib parses TOML in the standard library and does not write it
**Answer:** The stdlib `tomllib` module parses TOML. It does not support writing TOML. It was added in Python 3.11 with support for TOML 1.0.0, and it parses TOML 1.1.0 as of Python 3.15. `tomllib.load` reads a binary file object and returns a dict. Limit the size of input from an untrusted source, because a malicious string can use considerable CPU and memory.

PEP 680 proposed adding `tomllib` so that packaging and tool configs could be parsed without vendoring a third-party package.

## See also

- [python-json](https://iinventedlight.com/library/notes/python-json/)
- [toml-basics](https://iinventedlight.com/library/notes/toml-basics/)

## Claims

- id: C1
  claim: tomllib parses TOML and does not write it.
  source: S1
  evidence: "This module does not support writing TOML."

- id: C2
  claim: The module was added in 3.11 for TOML 1.0.0.
  source: S1
  evidence: "The module was added with support for TOML 1.0.0."

- id: C3
  claim: Current docs describe an interface for parsing TOML 1.1.0.
  source: S1
  evidence: "This module provides an interface for parsing TOML 1.1.0"

- id: C4
  claim: PEP 680 proposed adding tomllib to the standard library.
  source: S2
  evidence: "This PEP proposes adding the ``tomllib`` module to the standard library for"

## Sources

- [S1] tomllib — Parse TOML files. Python docs. https://docs.python.org/3/library/tomllib.html . License: PSF-2.0. Accessed 2026-11-16.

- [S2] PEP 680 – tomllib: Support for Parsing TOML in the Standard Library. Python PEPs. https://peps.python.org/pep-0680/ . License: Public domain or CC0-1.0. Accessed 2026-11-16.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python docs, tomllib — Parse TOML files, PSF-2.0 (https://raw.githubusercontent.com/python/cpython/main/LICENSE); Python PEPs, PEP 680 – tomllib: Support for Parsing TOML in the Standard Library, Public domain or CC0-1.0 (https://peps.python.org/pep-0680/ (Copyright section: public domain or CC0-1.0)). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
