Skip to main content

Build Status codecov.io PyPI version

Tomli-W

A lil' TOML writer

Table of Contents generated with mdformat-toc

Intro

Tomli-W is a Python library for writing TOML. It is a write-only counterpart to Tomli, which is a read-only TOML parser. Tomli-W is fully compatible with TOML v1.0.0.

Installation

pip install tomli-w

Usage

import tomli_w

doc = {"table": {"nested": {}, "val3": 3}, "val2": 2, "val1": 1}
expected_toml = """\
val2 = 2
val1 = 1

[table]
val3 = 3

[table.nested]
"""
assert tomli_w.dumps(doc) == expected_toml

FAQ

Does Tomli-W sort the document?

No, but it respects sort order of the input data, so one could sort the content of the dict (recursively) before calling tomli_w.dumps.

Does Tomli-W support writing documents with comments, custom whitespace, or other stylistic choices?

No.

Metadata

Release files for tomli-w 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tomli-w 0.1.0
File Size Uploaded Provenance Actions
tomli_w-0.1.0.tar.gz 4.8 kB Without provenance Details for tomli_w-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tomli-w 0.1.0
File Interpreter ABI Platform Actions
tomli_w-0.1.0-py3-none-any.whl Python 3 none any Details for tomli_w-0.1.0-py3-none-any.whl

Total release size: 9.4 kB

Release files / tomli_w-0.1.0.tar.gz

Download URL tomli_w-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d058b518cf46d67f482efa4e3b65dd172f924f62bde301a978d03325a4e9a8c4
BLAKE2b-256 checksum
How to use checksums
57aba90f9b3ec2087a3148789094ec7556dc07586d7693dd6b1a65ed617bc532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release files / tomli_w-0.1.0-py3-none-any.whl

Download URL tomli_w-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3db4ca675ce615256c0810bf09c9007672282c8b8dbe486c28c53434a727c69
BLAKE2b-256 checksum
How to use checksums
df2086121bcb0c7ee9aa259b38fd71009bca5868d6c25e66456691dad7c17a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Security for tomli-w 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page