tomlkit
Style preserving TOML library
Install
tomlkit on PyPI
pip
pip install tomlkituv
uv add tomlkitpoetry
poetry add tomlkitPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 27 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: tomlkit-0.15.1-py3-none-any.whl
About tomlkit
from the package's own PyPI description — quoted content, verbatim
GitHub Release (image) PyPI Version (image) Python Versions (image) License (image) <br> Tests (image)
TOML Kit - Style-preserving TOML library for Python
TOML Kit is a 1.1.0-compliant TOML library.
It includes a parser that preserves all comments, indentations, whitespace and internal element ordering, and makes them accessible and editable via an intuitive API.
You...
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
tomlkit parses and edits TOML 1.1.0 files while preserving comments, whitespace, indentation, and element order, then serializes them back with formatting intact.
Low friction: pure Python wheel with zero runtime dependencies and active maintenance (latest release 27 days ago, last commit 2026-08-10). Supports Python 3.9–3.14.
MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.
Usage
pip install tomlkit
import tomlkit
doc = tomlkit.parse('[section]\nkey = "value"')
doc['section']['key'] = 'new_value'
print(tomlkit.dumps(doc))
Verdict: tomlkit is a well-maintained, dependency-free TOML library ideal for applications that need to read and modify TOML files without losing formatting. No known vulnerabilities, permissive MIT license, and broad Python version support make it a safe, production-ready choice.
Needs verification
- Performance characteristics and memory footprint for very large TOML files
- Extent to which the documented sub-table normalization limitation affects real-world use cases
Similar packages
permissive · top 1,000 on PyPI
xmltodictpermissive · top 1,000 on PyPI
strictyamlpermissive · top 1,000 on PyPI
libcstpermissive · top 1,000 on PyPI
crashtestpermissive · top 1,000 on PyPI
fastavropermissive · top 1,000 on PyPI
pytest-envpermissive · top 1,000 on PyPI
tomli-wpermissive · top 1,000 on PyPI
sqlglotpermissive · top 1,000 on PyPI
texttablepermissive · top 1,000 on PyPI