Skip to main content

A format-preserving TOML reader and writer for Python.

Project description

tomlrt

PyPI Python versions License CI Docs

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/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tomlrt-1.7.4.tar.gz (309.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tomlrt-1.7.4-py3-none-any.whl (134.4 kB view details)

Uploaded Python 3

File details

Details for the file tomlrt-1.7.4.tar.gz.

File metadata

  • Download URL: tomlrt-1.7.4.tar.gz
  • Upload date:
  • Size: 309.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tomlrt-1.7.4.tar.gz
Algorithm Hash digest
SHA256 75713de22666c0b7b425842349c101c7c4dc1ce54892637609354d24df134848
MD5 d8ad07ae29adacc0a6f41368bbec45de
BLAKE2b-256 1efcdf2a17f735cd8e3ff5495e7696918ea64ad0f14cc4cf1a8acf60b759cf56

See more details on using hashes here.

Provenance

The following attestation bundles were made for tomlrt-1.7.4.tar.gz:

Publisher: publish.yml on dimbleby/tomlrt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tomlrt-1.7.4-py3-none-any.whl.

File metadata

  • Download URL: tomlrt-1.7.4-py3-none-any.whl
  • Upload date:
  • Size: 134.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tomlrt-1.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 728b7e42284b2da9aba57c4bbc4ea4d62372e3a1728777c39c3ed0cfa10396cf
MD5 74e466f68d46b7d2a7069a08223a61bd
BLAKE2b-256 d95b30bc76e84b1ed4cf472f02b0d8618e2fa8e88c5734fa95d846acf72098b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tomlrt-1.7.4-py3-none-any.whl:

Publisher: publish.yml on dimbleby/tomlrt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page