tomli-w
A lil' TOML writer
Install
tomli-w on PyPI
pip
pip install tomli-wuv
uv add tomli-wpoetry
poetry add tomli-wPackage facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 575 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: tomli_w-1.2.0-py3-none-any.whl
Keywords: toml, tomli
About tomli-w
from the package's own PyPI description — quoted content, verbatim
Build Status (image) codecov.io (image) PyPI version (image)
Tomli-W
> A lil' TOML writer
Table of Contents generated with mdformat-toc
<!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 -->
- Intro
- Installation
- Usage
- Write to string
- Write to file
- FAQ
- Does Tomli-W sort the document?
- Does Tomli-W support writing documents with comments?
- Can I customize insignificant whitespace?
- [Why does Tomli-W not write a multi-line string if the string value contains...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Tomli-W serializes Python dictionaries to TOML format, writing valid TOML documents to strings or files with configurable indentation and multiline string handling.
Low friction: pure Python wheel with zero runtime dependencies and active maintenance (last commit 2026-08-10, 575 days since release).
Permissive license treatment allows broad use; no license text restrictions noted in the fact sheet.
Usage
pip install tomli-w
import tomli_w
doc = {"table": {"nested": {}}, "val": 1}
toml_string = tomli_w.dumps(doc)
with open("config.toml", "wb") as f:
tomli_w.dump(doc, f)
Requires Python 3.9 or later.
Verdict: Tomli-W is a lightweight, actively maintained TOML serializer with no dependencies, permissive licensing, and zero known vulnerabilities. It is well-suited for projects that need to write TOML configuration files; note that it does not validate output or support comments, and users requiring strict validation should parse output with tomli.loads().
Needs verification
- Whether the package's handling of edge cases (non-string keys, type subclasses) matches the FAQ's caveats in production use.
- Real-world performance characteristics for large or deeply nested documents.
Similar packages
permissive · top 1,000 on PyPI
tomlipermissive · top 1,000 on PyPI
glompermissive · top 1,000 on PyPI
unidiffpermissive · top 1,000 on PyPI
tomlkitpermissive · top 1,000 on PyPI
iniconfigpermissive · top 100 on PyPI
poetrypermissive · top 1,000 on PyPI
isortpermissive · top 1,000 on PyPI
yamllintcopyleft · top 1,000 on PyPI
mdurlpermissive · top 100 on PyPI