skillfed

toml-rs

A High-Performance TOML Parser for Python written in Rust

toml-rs v0.3.16 104.6K downloads/30d#12,744 on PyPI32
Permissive license Unlicense Active released

What it is and what it does

toml-rs is a TOML parser and serializer implemented in Rust and exposed to Python, designed as a faster alternative to the standard library's tomllib. It parses TOML v1.0.0 and v1.1.0 into Python dictionaries and can serialize Python dictionaries back to TOML format. The package aims for drop-in compatibility with tomllib for most use cases, though it adds features like serialization (dumps/dump methods) and provides more detailed error messages that pinpoint parse failures with context.

The package has no runtime dependencies beyond Python itself, making installation straightforward on supported platforms. It supports Python 3.10 through 3.15 and runs on CPython and PyPy. The Rust implementation is the core differentiator—it trades the simplicity of a pure-Python parser for speed, which matters most when parsing large TOML files or in performance-sensitive applications.

Use it for:

  • Replace tomllib in projects requiring faster TOML parsing or better error diagnostics
  • Serialize Python configuration objects back to TOML files for config management workflows
  • Parse TOML configuration files in CLI tools or build systems where performance is measurable
  • Handle TOML v1.1.0 features in applications that need newer TOML spec support
  • Migrate from other TOML libraries while maintaining mostly compatible code

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A high-performance TOML parser and serializer for Python, written in Rust, with drop-in compatibility for most tomllib use cases and support for TOML v1.0.0 and v1.1.0.

Yes, if you need TOML parsing and either want faster performance than tomllib or need serialization support. The package is actively maintained, has no dependencies, and carries permissive licensing. Install friction is moderate due to compilation, but prebuilt wheels cover common platforms. No known vulnerabilities. Not necessary if tomllib's speed and read-only API suit your use case.

Install

toml-rs on PyPI

pip

pip install toml-rs

uv

uv add toml-rs

poetry

poetry add toml-rs

Installing toml-rs

Before you install

Medium install friction due to compiled wheels; prebuilt binaries available for common platforms (macOS, Linux, Windows across multiple architectures). Actively maintained with recent releases; repository shows 32 stars and last commit on 2026-08-14.

License in practice

Licensed under Unlicense (permissive), placing the package in the public domain with no restrictions on use, modification, or distribution.

Quickstart

pip install toml-rs

import toml_rs

toml_string = 'title = "Example"\n[section]\nkey = "value"'
data = toml_rs.loads(toml_string)
output = toml_rs.dumps(data)

Requires Python 3.10 or later; precompiled wheels available for most platforms but installation may require compilation on unsupported architectures.

Verify before relying

  • Actual performance comparison with tomllib and other TOML parsers (benchmarks referenced but not provided in fact sheet)
  • Completeness of tomllib compatibility beyond the stated differences
  • Support status for PyPy implementation (listed in classifiers but not detailed)

Package facts

License Unlicense (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 38 days since the last release
Last repo commit
First released
Downloads 104,598/month — #12,744 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: toml_rs-0.3.16-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; toml_rs-0.3.16-cp310-cp310-macosx_10_12_x86_64.whl; toml_rs-0.3.16-cp310-cp310-macosx_11_0_arm64.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_17_ppc64.manylinux2014_ppc64.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_31_riscv64.whl; toml_rs-0.3.16-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; toml_rs-0.3.16-cp310-cp310-musllinux_1_2_aarch64.whl; toml_rs-0.3.16-cp310-cp310-musllinux_1_2_armv7l.whl; toml_rs-0.3.16-cp310-cp310-musllinux_1_2_i686.whl; toml_rs-0.3.16-cp310-cp310-musllinux_1_2_ppc64le.whl; toml_rs-0.3.16-cp310-cp310-musllinux_1_2_riscv64.whl; toml_rs-0.3.16-cp310-cp310-musllinux_1_2_x86_64.whl; toml_rs-0.3.16-cp310-cp310-win32.whl; toml_rs-0.3.16-cp310-cp310-win_amd64.whl; toml_rs-0.3.16-cp310-cp310-win_arm64.whl

Keywords: TOML, TOML 1.0, TOML 1.1, TOML parser, TOML dumper

Development Status :: 5 - Production/StableProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: RustTopic :: Software Development :: LibrariesTyping :: Typed

Tags

toml parser pythonfast toml parsingtoml serializationtoml v1.0 v1.1rust toml librarytomllib alternativetoml dumps loads
toml-parsingrust-bindingconfig-format

More Libraries packages