Install & Compatibility
Where this runs
tested against v0.3.13 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✕ build_error
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
loads
✓ from toml_rs import loads
✗ import toml; toml.loads(...)
toml-rs is not the standard library toml; it's a separate package with module name toml_rs.
dumps
✓ from toml_rs import dumps
No common wrong import known.
load
✓ from toml_rs import load
Load from file.
load_with_metadata
✓ from toml_rs import load_with_metadata
Returns parsed TOML with metadata.
Basic parsing with loads() and load_with_metadata().
import toml_rs
toml_string = """
title = "Example"
[owner]
name = "Alice"
"""
parsed = toml_rs.loads(toml_string)
print(parsed["title"]) # Example
print(parsed["owner"]["name"]) # Alice
# With metadata
toml_string = "x = 1"
result = toml_rs.load_with_metadata(toml_string, toml_version="1.0.0")
print(result.data) # {'x': 1}
print(result.meta) # metadata object
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'toml'
Trying to import 'toml' instead of 'toml_rs'.
fixUse 'import toml_rs' (the module name is toml_rs, not toml).
toml_rs._lib.TOMLDecodeError: TOML parse error at line 1, column 9 ... carriage return must be followed by newline, expected newline
Input contains a bare carriage return character (\r) not followed by newline (\n).
fixReplace '\r' with '\r\n' or '\n' before parsing.
TypeError: loads() got an unexpected keyword argument 'toml_version'
Using an older version (<0.2.0?) that doesn't support toml_version.
fixUpgrade to latest: pip install --upgrade toml-rs
Upgrade
Version history
0.3.13latest on PyPI · released May 13, 2026
Audit
Dependencies
No dependency data recorded yet.