Metadata-Version: 2.4
Name: tomlrt
Version: 1.0.3
Summary: A format-preserving TOML reader and writer for Python.
Project-URL: Repository, https://github.com/dimbleby/tomlrt
Project-URL: Documentation, https://dimbleby.github.io/tomlrt/
Project-URL: Issues, https://github.com/dimbleby/tomlrt/issues
Project-URL: Changelog, https://github.com/dimbleby/tomlrt/blob/main/CHANGELOG.md
Author-email: David Hotham <david.hotham@blueyonder.co.uk>
License-Expression: MIT
License-File: LICENSE
Keywords: config,configuration,format-preserving,pyproject,round-trip,toml,toml-parser,toml-writer,tomlrt
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: typing-extensions>=4; python_version < '3.12'
Description-Content-Type: text/markdown

# tomlrt

[![PyPI](https://img.shields.io/pypi/v/tomlrt.svg)](https://pypi.org/project/tomlrt/)
[![Python versions](https://img.shields.io/pypi/pyversions/tomlrt.svg)](https://pypi.org/project/tomlrt/)
[![License](https://img.shields.io/pypi/l/tomlrt.svg)](https://github.com/dimbleby/tomlrt/blob/main/LICENSE)
[![CI](https://github.com/dimbleby/tomlrt/actions/workflows/ci.yml/badge.svg)](https://github.com/dimbleby/tomlrt/actions/workflows/ci.yml)
[![Docs](https://img.shields.io/badge/docs-zensical-informational)](https://dimbleby.github.io/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.

```python
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:

```python
import tomlrt

doc = tomlrt.document({"project": {"name": "demo", "version": "0.1.0"}})
print(tomlrt.dumps(doc))
```

## Documentation

Full docs at <https://dimbleby.github.io/tomlrt/>:
