A format-preserving TOML reader and writer for Python.
Project Links
Meta
Author: David Hotham
Requires Python: >=3.11
Classifiers
Intended Audience
- Developers
Operating System
- OS Independent
Programming Language
- Python :: 3
Typing
- Typed
tomlrt
A format-preserving TOML reader and writer for Python.
Parse a document, edit it, dump it, and the bytes you didn't touch round-trip exactly — comments, whitespace, string style, and number formatting all intact.
Supports TOML 1.1.
import tomlrt
with open("pyproject.toml", "rb") as f:
doc = tomlrt.load(f)
doc["project"]["version"] = "0.2.0"
doc["project"]["dependencies"].append("requests>=2")
print(tomlrt.dumps(doc)) # comments and layout are preserved
Build a document from scratch:
from tomlrt import Document, dumps
doc = Document({"project": {"name": "demo", "version": "0.1.0"}})
print(dumps(doc))
Documentation
Full docs at https://dimbleby.github.io/tomlrt/.
2.3.2
Oct 23, 2026
2.3.1
Oct 17, 2026
2.3.0
Oct 09, 2026
2.2.14
Sep 25, 2026
2.2.13
Sep 20, 2026
2.2.12
Sep 15, 2026
2.2.11
Sep 14, 2026
2.2.10
Sep 13, 2026
2.2.9
Sep 12, 2026
2.2.8
Sep 12, 2026
2.2.7
Sep 06, 2026
2.2.6
Aug 30, 2026
2.2.5
Aug 24, 2026
2.2.4
Aug 23, 2026
2.2.3
Aug 17, 2026
2.2.2
Aug 13, 2026
2.2.1
Aug 04, 2026
2.2.0
Jul 24, 2026
2.1.1
Jul 21, 2026
2.1.0
Jul 20, 2026
2.0.2
Jul 10, 2026
2.0.1
Jun 28, 2026
2.0.0
Jun 22, 2026
1.8.3
Jun 17, 2026
1.8.2
Jun 14, 2026
1.8.1
Jun 14, 2026
1.8.0
Jun 13, 2026
1.7.6
Jun 12, 2026
1.7.5
Jun 11, 2026
1.7.4
Jun 09, 2026
1.7.3
Jun 07, 2026
1.7.2
Jun 01, 2026
1.7.1
May 31, 2026
1.7.0
May 25, 2026
1.6.1
May 25, 2026
1.6.0
May 25, 2026
1.5.0
May 24, 2026
1.4.3
May 24, 2026
1.4.2
May 10, 2026
1.4.1
May 10, 2026
1.4.0
May 08, 2026
1.3.2
May 04, 2026
1.3.1
May 03, 2026
1.3.0
May 02, 2026
1.2.0
May 02, 2026
1.1.0
Apr 30, 2026
1.0.3
Apr 30, 2026
1.0.2
Apr 27, 2026
1.0.1
Apr 26, 2026
1.0.0
Apr 26, 2026
0.6.0
Apr 25, 2026
0.5.0
Apr 24, 2026
0.4.0
Apr 23, 2026
0.3.0
Apr 21, 2026
0.2.0
Apr 20, 2026
0.1.0
Apr 20, 2026
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
typing_extensions
(>=4)