tomli
A lil' TOML parser
Install
tomli on PyPI
pip
pip install tomliuv
uv add tomlipoetry
poetry add tomliPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 141 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-2.4.1-py3-none-any.whl
Keywords: toml
About tomli
from the package's own PyPI description — quoted content, verbatim
Build Status (image) codecov.io (image) PyPI version (image)
Tomli
> A lil' TOML parser
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 parses TOML configuration files into Python dictionaries. It provides a lightweight, pure-Python parser compatible with TOML v1.1.0 and offers a backport for Python versions before 3.11 when the standard library tomllib is unavailable.
Tomli has zero runtime dependencies and installs as a pure Python wheel with no compilation required, making it frictionless to add. The project is actively maintained with recent releases and 570 GitHub stars.
Tomli is released under the MIT license, a permissive license that allows free use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial projects.
Usage
pip install tomli
import tomli
with open("config.toml", "rb") as f:
config = tomli.load(f)
# or parse a string:
data = tomli.loads("key = 'value'")
TOML files must be opened in binary mode ("rb") to ensure UTF-8 decoding with universal newlines disabled, as required by the TOML specification.
Verdict: Tomli is a reliable, minimal TOML parser with no dependencies, active maintenance, and MIT licensing. It's well-suited for configuration file parsing across Python 3.8+ and serves as a backport for users on Python versions before 3.11. No known vulnerabilities.
Needs verification
- Performance comparison with tomllib in Python 3.11+ to assess whether mypyc-compiled wheels justify adoption over the standard library
- Whether the package's 100% branch coverage claim and spec compliance against toml-lang/toml-test have been independently verified
Similar packages
permissive · top 1,000 on PyPI
tomlkitpermissive · top 1,000 on PyPI
deepdiffpermissive · top 1,000 on PyPI
pytest-envpermissive · top 1,000 on PyPI
mdurlpermissive · top 100 on PyPI
orjsoncopyleft · top 1,000 on PyPI
poetrypermissive · top 1,000 on PyPI
backports.zstdpermissive · top 1,000 on PyPI
pytokenspermissive · top 1,000 on PyPI
msgspecpermissive · top 1,000 on PyPI