# TOML Kit

> Style-preserving TOML library for Python that keeps comments and layout

Source: https://talira.ai/catalog/toml-kit-6k5eyez9
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / parsing / toml](https://talira.ai/categories/developer-tools/parsing/toml), [languages / python](https://talira.ai/categories/languages/python)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Supports: [TOML](https://talira.ai/standards/toml.md)[^1]
- Backed by: [Sébastien Eustace](https://talira.ai/orgs/sebastien-eustace.md)

TOML Kit (tomlkit) is a TOML 1.1.0-compliant library for Python whose parser keeps every comment, indentation, whitespace and element order, so a program can edit a TOML file such as pyproject.toml and write it back without disturbing its layout. It can also build new TOML documents from scratch. It's from the python-poetry organisation.

## Links

- GitHub: https://github.com/python-poetry/tomlkit
- Docs: https://tomlkit.readthedocs.io/

## Problems it solves

- update a value in pyproject.toml from a script without losing the comments
- edit a TOML config file in Python and keep its formatting
- generate a TOML file from Python

## Features

- TOML 1.1.0 compliant
- parser that preserves comments, indentation, whitespace and element order
- edit a document through its API and write it back with the layout intact
- create new TOML documents from scratch

## Limitations

- A sub-table that extends an array of tables out of order is moved into the array's last element when the document is written back; the data is kept but its placement changes.[^1]

## Trust

Overall: 0.62 out of 1.
Signals: maintenance 1.00, adoption 0.59, momentum 0.30, community 0.81, backing 0.30, extensibility 0.00.

- last commit 3 days ago
- 81 commits in the last 90 days
- latest release 0.15.3 6 days ago
- 872 GitHub stars
- 104 contributors
- accepts sponsorship (Github)
- backed by Sébastien Eustace

## Alternatives

- [Tomli](https://talira.ai/catalog/tomli-apnq570d.md): Small, fast TOML 1.1.0 parser for Python

## Sources

[^1]: https://github.com/python-poetry/tomlkit/blob/master/README.md (checked 29 Nov 2026)
[^2]: https://github.com/python-poetry/tomlkit/blob/master/LICENSE (checked 29 Nov 2026)
