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.

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.3.1.tar.gz (208.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.3.1-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tomlrt-1.3.1.tar.gz
  • Upload date:
  • Size: 208.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.3.1.tar.gz
Algorithm Hash digest
SHA256 6dc2b730dd0865f8869f43622ce14c6b08744dba0d4ae7ed71740f5c2d193161
MD5 0dd665819357da7c37d2f91292aa8ed4
BLAKE2b-256 bef498e5c87fd9924e038655ffe0a723e1de405944e2d05535112c8c6b99a90f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tomlrt-1.3.1.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.3.1-py3-none-any.whl.

File metadata

  • Download URL: tomlrt-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 83.1 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d32e454d3be8f4dfd6708200bfb21d7f4335cb8ab38195195fd04f2de7829f7d
MD5 a873cf3f0b2844beb58c2cb58a8cf99f
BLAKE2b-256 076815da94bbb6cdfd52b32462ff6fa8a92092901ed2a751afc94ea54a883acb

See more details on using hashes here.

Provenance

The following attestation bundles were made for tomlrt-1.3.1-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