skillfed

tomli-w

A lil' TOML writer

tomli-w Permissive license Active 141 v1.2.0 released

Install

tomli-w on PyPI

pip

pip install tomli-w

uv

uv add tomli-w

poetry

poetry add tomli-w

Package 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

License :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

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

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.
toml writer pythonserialize dict to tomltoml dump librarypython toml encoderwrite toml filestoml generationdict to toml format

Similar packages