Registry / serialization / rtoml
library0.13.0pypypi✓ verified 31d ago

rtoml is a high-performance Python library for parsing and serializing TOML, implemented in Rust. It emphasizes correctness, speed, and flexible handling of `None` values, passing all standard TOML tests. It currently requires Python 3.10 or newer and is actively maintained with frequent updates.

pip install rtoml
INSTALL
IMPORT
SIG · RTOML
R
rtoml
serializationpythonv0.13.0
Install
1.6s avg
Import
23ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.13.0 · 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
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.026s · 18.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.020s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

load
✓ from rtoml import load
✗ import rtoml
loads
✓ from rtoml import loads
✗ import rtoml
dump
✓ from rtoml import dump
✗ import rtoml

This quickstart demonstrates how to serialize a Python dictionary to a TOML string using `rtoml.dumps` and then parse it back using `rtoml.loads`. It also highlights the default behavior of `None` values.

import rtoml # Define a Python object obj = { 'title': 'TOML Example', 'owner': { 'name': 'Tom Preston-Werner', }, 'database': { 'server': '192.168.1.1', 'ports': [8001, 8001, 8002], 'connection_max': 5000, 'enabled': True, 'option_none': None # Example with None }, } # Serialize Python object to TOML string toml_string = rtoml.dumps(obj, pretty=True) print("Generated TOML:\n", toml_string) # Load TOML string back into a Python object loaded_obj = rtoml.loads(toml_string) print("\nLoaded object:\n", loaded_obj) # Verify round-trip (Note: None handling defaults differ) # For exact match with None, dumps(none_value=None) or loads(none_value='null') might be needed assert loaded_obj['database']['option_none'] is None assert loaded_obj['database']['enabled'] == obj['database']['enabled']
Debug
Known issues
breakingPython 3.8 support was dropped in `rtoml` version `0.12.0`.
fix
Upgrade your Python environment to version 3.10 or newer, as required by `rtoml`.
affects: >=0.12.0
breakingPython 3.7 support was dropped in `rtoml` version `0.10.0`.
fix
Upgrade your Python environment to version 3.10 or newer, as required by `rtoml`.
affects: >=0.10.0
gotchaThe default handling of `None` values differs between `rtoml.loads` and `rtoml.dumps`. By default, `loads` ignores TOML keys with `none_value` (which is `None` by default), effectively treating them as if they don't exist in the input. Conversely, `dumps` will serialize Python `None` as the string `"null"` by default (`none_value="null"`). This can lead to unexpected behavior during round-tripping if not explicitly configured.
fix
For consistent `None` handling, explicitly set the `none_value` parameter. For example, use `rtoml.dumps(..., none_value=None)` to omit `None` values from the output, or `rtoml.loads(..., none_value='null')` to parse a specific string (like `null`) into Python's `None`.
affects: All versions
Upgrade
Version history
0.13.0latest on PyPI · released Oct 19, 2025
Audit
Dependencies
rustoptionalRequired for installation if pre-built wheels are not available for your system configuration.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
rtoml — pip install rtoml · libregistry