$npx skillfedfor your agent

tomlkit

Style preserving TOML library

Worth itPyPI MarkupReleased Jul 2026338.0M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — tomlkit-0.15.1-py3-none-any.whl
v0.15.1 · released 2026-07-17 · Python >=3.9

Yes. Tomlkit is a solid choice for any Python project that needs to read or edit TOML files while preserving formatting. It has no dependencies, is actively maintained, supports current Python versions, carries no known vulnerabilities, and is licensed permissively under MIT. Install it if you're building tools that touch TOML files and user readability of the source matters.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low friction: pure Python wheel with no runtime dependencies.
  • Actively maintained with a release 28 days ago and recent commits.

License · maintenance · safety

MIT (permissive) — MIT license (permissive): you can use, modify, and distribute tomlkit freely in commercial and private projects with minimal restrictions.

last release 2026-07-17 (28 days) · last repo commit 2026-08-10 · 842 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 338,023,114 downloads/mo, #124 on PyPI

Verify before relying

pip install tomlkit

import tomlkit

doc = tomlkit.parse(open('config.toml').read())
doc['key'] = 'value'
print(tomlkit.dumps(doc))
  • Whether the documented limitation (sub-table reordering in array-of-tables contexts) affects your use case.
  • Performance characteristics when handling very large TOML documents.
Same gist for agents: .md · .json

What it is and what it does

Tomlkit is a TOML 1.1.0-compliant parser and serializer that treats TOML documents as editable objects while preserving all formatting details—comments, indentation, whitespace, and element order. Unlike standard TOML parsers that discard formatting on read, tomlkit reconstructs the original layout when you serialize the document back, making it suitable for tools that need to modify configuration files without losing user-added structure or notes.

It has no runtime dependencies and works across Python 3.9 through 3.14. You can parse existing TOML files, modify their contents programmatically, and write them back with formatting intact, or create new TOML documents from scratch using provided helpers. The library is actively maintained and widely used in the Python ecosystem.

Use it for

  • Edit pyproject.toml or other config files programmatically while preserving user comments and formatting.
  • Build tools that read and modify TOML configuration without losing manual edits or structure.
  • Round-trip TOML documents through Python code without normalizing or reformatting them.
  • Create TOML documents from scratch with an intuitive API for setting values and sections.
  • Parse TOML in applications where preserving the original document layout is important for user experience.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Tomlkit is a solid choice for any Python project that needs to read or edit TOML files while preserving formatting. It has no dependencies, is actively maintained, supports current Python versions, carries no known vulnerabilities, and is licensed permissively under MIT. Install it if you're building tools that touch TOML files and user readability of the source matters.

Install

tomlkit on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a release 28 days ago and recent commits. Supports Python 3.9 through 3.14.

Requires Python 3.9 or later.

License in practice

MIT license (permissive): you can use, modify, and distribute tomlkit freely in commercial and private projects with minimal restrictions.

Quickstart

pip install tomlkit

import tomlkit

doc = tomlkit.parse(open('config.toml').read())
doc['key'] = 'value'
print(tomlkit.dumps(doc))

Verify before relying

  • Whether the documented limitation (sub-table reordering in array-of-tables contexts) affects your use case.
  • Performance characteristics when handling very large TOML documents.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 28 days since the last release
Last repo commit
First released
Downloads338,023,114 / month, #124 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Evidence: tomlkit-0.15.1-py3-none-any.whl

Tags

Capabilities
TOML parser preserve formattingstyle-preserving TOML libraryedit TOML files keep commentsTOML 1.1.0 compliant parserround-trip TOML serializationprogrammatic TOML manipulation
Topics
toml-parsingconfig-management

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “TOML parser preserve formatting”

  • tomlkitParses and edits TOML files while preserving formatting, comments,…
  • tree-sitter-tomlProvides a tree-sitter parser grammar for TOML files, enabling…
  • tomlrtReads and writes TOML files while preserving formatting, comments,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Markup packages

PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
markdown-it-py Worth it
PyPI · Python Modules · released May 2026

A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.

Install it if you need reliable markdown-to-HTML conversion.

MITpure Python · 3.10+
613.8Mdownloads / mo
beautifulsoup4 Worth it
PyPI · Python Modules · released Jun 2026

Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.

Install it if you need to parse or extract data from markup documents.

MITpure Python · 3.7.0+
432.1Mdownloads / mo
et-xmlfile With conditions
PyPI · Markup · released Oct 2024

et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.

Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.

MITpure Python · 3.8+dormant
343.3Mdownloads / mo
docstring-parser Worth it
PyPI · Python Modules · released Apr 2026

Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.

Install it if you need to programmatically read and extract structured data from Python docstrings.

MITpure Python · 3.8+
274.9Mdownloads / mo
docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo

See also tomlrt · tomli · codemod-yaml · tox-toml-fmt · toml-sort · pytoml · pyproject-fmt · commented-configparser · untokenize · lkml