Repository navigation
mojo-toml v0.2.2
mojo-toml-public v0.2.2
Released: 2026-11-04 · Commit: 84426c7 · Previous: v0.2.1
What it does
A TOML 1.1 parser written in pure Mojo. It passes the complete official
conformance suite, toml-test v2.2.0:
214/214 valid and 467/467 invalid documents, on Mojo 1.2.0 and on the 1.2 nightly.
from toml import parse
def main() raises:
var doc = parse(open("config.toml", "r").read())
var server = doc["server"]
print(server["host"].as_string(), server["port"].as_int())Highlights
- Integer tokens are parsed from a view with no copy and no digit list, so parsing is faster.
parseis smoke-tested against random input: it raises, it never crashes.
Changes
Added
recipe.yaml: a conda package recipe.- A property smoke step in the gate:
parsenever crashes. mojo-upgradeconfig.- CI, latest-release and license badges in the README.
Changed
- Integer tokens are parsed from a view, no copy and no digit list.
- README: one install and quickstart block, one example.
Fixed
- Integers outside the signed 64-bit range are rejected.
- Array and inline-table nesting is bounded at 128 levels.
- Seconds are not inserted before a fraction:
07:32.5is invalid.
Verified
| Check | Result |
|---|---|
ci-local: the GitHub workflow in a clean Ubuntu 24.04 container (toml-test 214/214 valid, 467/467 invalid) |
PASS (2351c89) |
Known limits
- As in v0.2.1.
Upgrade / run
uv sync # installs Mojo 1.2.0
Commits
2351c89fix(ci): fetch mojo-proptest at a pinned commit when no sibling checkout exists84426c7fix(release): pyproject.toml, recipe.yaml, uv.lock say 0.2.2063bef4build: mojo-upgrade configa613983perf(toml): integer tokens are parsed from a view, no copy and no digit listf2b83d1test: property smoke step, parse never crashes4a18663build: conda recipe961ef4edocs: one example, one install blockb272c6adocs: install and quickstart blockd99d0b8build(toml): uv.lock project version 0.2.125cf43arefactor(toml): drop the unused TIME_LOCAL import in json.mojoc5a9118docs(toml): Mojo 1.2.0 everywhere, version 0.2.1 matches the taga77bfe6fix(toml): do not insert seconds before a fraction (07:32.5 is invalid)604e9fdfix(toml): bound array and inline-table nesting at 1287703ef1fix(toml): reject integers outside the signed 64-bit range0a44020docs: CI, latest-release and license badges