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 rtomlVerified import paths — ran on the pinned version, not inferred.
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.
Upgrade your Python environment to version 3.10 or newer, as required by `rtoml`.
Upgrade your Python environment to version 3.10 or newer, as required by `rtoml`.
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`.