toml.bzl 0.3.0Latest published 4.4mo ago
MODULE.bazel
bazel_dep(name = "toml.bzl", version = "0.3.0")
README

toml.bzl

A pure Starlark TOML 1.1.0 encoder and decoder.

Usage

For full API documentation, see the API Reference.

For installation instructions, see Releases.

In a .bzl file

load("@toml.bzl", "toml")

content = """
[database]
server = "192.168.1.1"
ports = [ 8000, 8001, 8002 ]
"""

# Decode
config = toml.decode(content)
print(config["database"]["server"])

# Encode
encoded = toml.encode(config)
print(encoded)

Performance

toml.bzl is highly optimized for the Starlark interpreter, leveraging native string operations to achieve high throughput while maintaining 100% compliance with TOML 1.1.0.

Benchmarks

Tested on an Apple M3 MacBook Pro:

Document Type Size Time Performance
Cargo.lock 1.5 MB 180 ms ~8 MB/s
Scalar Parsing - - ~35,000 items/s

Compliance

The implementation is verified against the toml-test suite, passing all compliance tests (decoding and encoding).

About

Pure-Starlark TOML library

@jvolkman/toml.bzl@jvolkman
Homepage
11stars
Monday, January 5, 2026

Languages

Maintainers

@jvolkman

Versions

0.2.1 +8h2025-12-30
0.2.0 +1d2025-12-29
0.1.1 +6h2025-12-28
0.1.02025-12-28