Skip to main content

teptris-py — TOML for Python at libleptris speed

A native C-extension binding (no ctypes, no fallback) over libteptris — the TOML counterpart of leptris-py (XML) and yeptris-py (YAML). API shape mirrors tomllib/tomli (loads/load raising TOMLDecodeError) plus a dumps writer in the tomli_w spirit. Datetime mapping mirrors tomllib: aware/naive datetime, date, time.

Both directions are native: dumps walks the object tree in C through the builder API and emits via the shared engine emitter — 3.5×–14.2× faster than tomli_w on every benchmark shape. The engine implements the TOML 1.1 draft grammar (a strict superset of 1.0) with 100% toml-test conformance, and parses at ≥3× the best C/C++ competitor on every shape.

Performance (end-to-end, Python tier)

Best-of-12 runs on a GitHub ubuntu-latest runner (python 3.12), 2026-09-21, over the generated bench corpus (~700 KB per shape). The full per-shape table regenerates on every main push via the lang-tier lane.

Shape teptris tomllib (stdlib) tomlkit (pure) rtoml (rust)
array_heavy 6.8 ms / 107 MB/s 236 ms / 3.1 MB/s 1,740 ms / 0.4 MB/s 34 ms / 21 MB/s
cargo_like 3.8 ms / 94 MB/s 100 ms / 3.5 MB/s 1,074 ms / 0.3 MB/s 18 ms / 20 MB/s
datetime_heavy 26.1 ms / 41 MB/s 227 ms / 4.8 MB/s 1,680 ms / 0.6 MB/s 40 ms / 27 MB/s
deep_tables 2.2 ms / 109 MB/s 82 ms / 3.0 MB/s 14,713 ms / 0.0 MB/s 13 ms / 18 MB/s
mixed 5.5 ms / 80 MB/s 150 ms / 2.9 MB/s 1,385 ms / 0.3 MB/s 27 ms / 16 MB/s
scalar_float 12.7 ms / 115 MB/s 310 ms / 4.7 MB/s 2,243 ms / 0.7 MB/s 61 ms / 24 MB/s
scalar_int 11.8 ms / 108 MB/s 300 ms / 4.3 MB/s 2,038 ms / 0.6 MB/s 54 ms / 24 MB/s

End to end (parse + materialize into Python objects): 4.8-6x rtoml (the rust-backed incumbent), 19-42x the stdlib's tomllib, and hundreds of times tomlkit per shape. rtoml numbers include its own object construction; both libraries materialize fully.

Packaging

pip install teptris resolves one of 10 cp39-abi3 wheels — manylinux/musllinux x86_64, aarch64 and armv7l (32-bit ARM, built under qemu), macOS arm64 and x86_64, Windows AMD64 and ARM64 — covering every CPython >= 3.9 including future minors. The extension statically links libteptris, so each wheel is a single self-contained module (no shared-library chain). Linux wheels build the engine inside each container via cibuildwheel so musllinux links musl; the manylinux wheels carry the maximal tag set (glibc >= 2.17).

Every wheel also carries the engine C SOURCE at teptris/_engine (beside the compiled extension) — the recompile path for rebuilding against your own environment. The sdist vendors the same tree and compiles automatically at install.

Every other platform (FreeBSD, Solaris/illumos, any CPython on an exotic arch) installs the sdist, which vendors the engine and compiles it with the installing interpreter's compiler — a C compiler is required, and the build fails loudly without one.

Many-small batch (loads_batch)

Parse a list of TOML documents in ONE C call (teptris_parse_batch):

docs = teptris.loads_batch([toml_str_a, toml_str_b, toml_str_c])
# => [dict, dict, dict] — same datetime contract as loads()

The first failing document raises TOMLDecodeError carrying its line/column. Honest perf shape (benchmark/batch_tier.py): per-doc loads in a tight loop is faster on every measured shape (6.3x on 2000 tiny docs, 3.2x medium, 1.3x large — CPython's per-call overhead amortizes better than the batch's scratch + object pressure). Use loads_batch for the single API surface, one C crossing, and the per-doc error report — not for speed.

Lazy load (loads_lazy)

When most of the parsed tree is going to be ignored, loads_lazy returns a LazyNode wrapper that materializes host objects only along the paths actually accessed:

doc = teptris.loads_lazy(big_toml)
# one parse, no dicts/lists materialized yet
sku = doc["items"][0]["sku"].value()   # walks the path; scalars
                                       # materialize at .value()
rest = doc["items"]                    # returns a LazyNode for the array
for it in rest:
    print(it["sku"].value())
# flatten eagerly if you want the same dict-tree shape as loads()
flat = doc.to_dict()

LazyNode exposes kind() ('table' | 'array' | 'scalar'), value() (scalars only — errors on containers), len() (containers), iteration (tables yield (key, LazyNode) pairs; arrays yield LazyNodes), [] (table key or array index — None for absent), and to_dict() / to_list() for eager flattening. Datetime values materialize via the same datetime.datetime / date / time contract as loads(). The document and the borrowed-bytes input are kept alive by the wrapper until GC.

Same datetime contract as loads(). The eager path is the floor for "flatten everything" workloads; the lazy path is the win for "parse once, touch a small subset."

Development

setup.py links the engine statically when it finds libteptris.a/teptris.lib under TEPTRIS_LIBDIR (what the wheels ship); otherwise it falls back to the shared library with an rpath to its build tree. Point TEPTRIS_INCLUDE/TEPTRIS_LIBDIR at a C checkout's build and run the suite:

cmake -B ../teptris/build -S ../teptris \
    -DCMAKE_BUILD_TYPE=Release -DTEPTRIS_BUILD_SHARED=OFF -DTEPTRIS_BUILD_STATIC=ON
cmake --build ../teptris/build
TEPTRIS_INCLUDE=../teptris/src/include TEPTRIS_LIBDIR=../teptris/build/src \
    python3 setup.py build_ext --inplace
PYTHONPATH=src python3 -m unittest discover -s tests -v

Publishing and version numbers are USER release decisions.

Metadata

Release files for teptris 0.2.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for teptris 0.2.23
File Size Uploaded Provenance
teptris-0.2.23.tar.gz 85.8 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for teptris 0.2.23
File
teptris-0.2.23-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
teptris-0.2.23-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
teptris-0.2.23-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
teptris-0.2.23-cp39-abi3-musllinux_1_2_armv7l.whl CPython 3.9 abi3 Linux musl 1.2+ ARMv7l Details
teptris-0.2.23-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
teptris-0.2.23-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
teptris-0.2.23-cp39-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl CPython 3.9 abi3 Linux glibc 2.17+ IBM System/390x, Linux glibc 2.28+ IBM System/390x Details
teptris-0.2.23-cp39-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.28+ PowerPC 64-le, Linux glibc 2.17+ PowerPC 64-le Details
teptris-0.2.23-cp39-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl CPython 3.9 abi3 Linux glibc 2.17+ ARMv7l, Linux glibc 2.31+ ARMv7l Details
teptris-0.2.23-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 Details
teptris-0.2.23-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
teptris-0.2.23-cp39-abi3-macosx_10_9_x86_64.whl CPython 3.9 abi3 macOS 10.9+ x86-64 Details

Total release size: 2.1 MB

Release files / teptris-0.2.23.tar.gz

Download URL teptris-0.2.23.tar.gz
Size 85.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a33ab17db6d13ecc3dadde7e9738309ff7355d90576424cf183fedcaea969884
BLAKE2b-256 checksum
How to use checksums
acb2f7cfcd052a1c3af9f0058ec4439fcbe4a7a52baa2c1037b278a24d59f5b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-win_arm64.whl

Download URL teptris-0.2.23-cp39-abi3-win_arm64.whl
Size 136.2 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
80b690632164093beaa59aed6b0fa8c0554f363805fe5518127c52751c71c1e3
BLAKE2b-256 checksum
How to use checksums
88bc648ab4afdf8c10211f01553441022c491f6f7ace267aad2772c99a49be61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-win_amd64.whl

Download URL teptris-0.2.23-cp39-abi3-win_amd64.whl
Size 138.1 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
05fa7da4c75f5e65f824f41c4708ee958145f032a74d323418a880f9bb9b09f1
BLAKE2b-256 checksum
How to use checksums
8b9da86844988ba93e8aa51741314a358919a8f9e8cab6d6a63ae493ad6b5c65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL teptris-0.2.23-cp39-abi3-musllinux_1_2_x86_64.whl
Size 180.0 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
8b5e528e44d41b307047b6ab1f06b478b51fbe3ac6d6160c0151ac51160328bc
BLAKE2b-256 checksum
How to use checksums
f8284e9f7a5022f3ef8f6a9989169409331629231f81bfe99de88f2d5ae2d3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-musllinux_1_2_armv7l.whl

Download URL teptris-0.2.23-cp39-abi3-musllinux_1_2_armv7l.whl
Size 182.1 kB
Tags CPython 3.9 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
b3e6e6ca298106ce9be9bf3af67a25070edc7c7541488583bfacbaadf1b45b8a
BLAKE2b-256 checksum
How to use checksums
f30d20a62e6fdb55c64fbcb655d922d8723217fe77302107032579ce711cd9fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL teptris-0.2.23-cp39-abi3-musllinux_1_2_aarch64.whl
Size 185.8 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
907b96a4d79146ba4d0400a837800288ff689d1f2ccad4bb9f4bdf41720b2cbe
BLAKE2b-256 checksum
How to use checksums
8b16f7625eaec5a04100291cc44e375b7b1ea2916c0606965178c194b957cb13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL teptris-0.2.23-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 178.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d5d67cd82c1d95915d57b3cfa27dc8fb3e2a485b89df29aca349331233de9d96
BLAKE2b-256 checksum
How to use checksums
6e9157fc946ae9d82214c227df66447b247fbcbce107a4c2869e420df60d1687
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl

Download URL teptris-0.2.23-cp39-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl
Size 183.4 kB
Tags CPython 3.9 Linux glibc 2.17+ IBM System/390x Linux glibc 2.28+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
a3ec3df3f6dc98ecc48db7f8b047ca10376103525105faea3aaec664ffa8264e
BLAKE2b-256 checksum
How to use checksums
510419a2e6bf1d6c96580e17b7e9bf3f04b72e189138c3629a4fe8389afef68e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl

Download URL teptris-0.2.23-cp39-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl
Size 190.4 kB
Tags CPython 3.9 Linux glibc 2.17+ PowerPC 64-le Linux glibc 2.28+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
542145af47c9b18c7b762999538edd48372e683616585baf76bd3e4614387ab4
BLAKE2b-256 checksum
How to use checksums
750692ebec78d0db7765ed42cc44629727d41418bb9ff7e0a2020d1d50e92fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl

Download URL teptris-0.2.23-cp39-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl
Size 185.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARMv7l Linux glibc 2.31+ ARMv7l abi3
SHA-256 checksum
How to use checksums
b39ce9dc1f61050dced3ca78c0d12ef6b826175a62b6d2937b004f42467b37dd
BLAKE2b-256 checksum
How to use checksums
a6ac69d1045c7724a7ccc616fa440482f109c87347ed66eeca13acd6c40fc858
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL teptris-0.2.23-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 184.9 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
63c778ce562a727cf0ad7972540dada95fbf72936a802097627c9a99f3fd2b00
BLAKE2b-256 checksum
How to use checksums
7778a932507588d4c6e8ab5453f4d81a53fa48f62611968e8913ac62290e530b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-macosx_11_0_arm64.whl

Download URL teptris-0.2.23-cp39-abi3-macosx_11_0_arm64.whl
Size 154.2 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b1dfa55d9316c7df87fa4ce050d87d0a01ab7ad34ea74190f820b6c792d7eb56
BLAKE2b-256 checksum
How to use checksums
24f38248834c289e689f9bbc02a1c01c36a15232bd257add391581b5619c77aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / teptris-0.2.23-cp39-abi3-macosx_10_9_x86_64.whl

Download URL teptris-0.2.23-cp39-abi3-macosx_10_9_x86_64.whl
Size 153.8 kB
Tags CPython 3.9 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0a7d1d212d75dafdabe80a336d0237527af0e912b2ccf7935708cace2c639cb1
BLAKE2b-256 checksum
How to use checksums
d78530c00a6408544ce5add570c8833d5f1de18fb19f77589a939b0a7e416221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Security for teptris 0.2.23

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.23 This release

13 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page