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.

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.21

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.21
File Size Uploaded Provenance
teptris-0.2.21.tar.gz 82.8 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for teptris 0.2.21
File
teptris-0.2.21-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
teptris-0.2.21-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
teptris-0.2.21-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
teptris-0.2.21-cp39-abi3-musllinux_1_2_armv7l.whl CPython 3.9 abi3 Linux musl 1.2+ ARMv7l Details
teptris-0.2.21-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
teptris-0.2.21-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
teptris-0.2.21-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.21-cp39-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.17+ PowerPC 64-le, Linux glibc 2.28+ PowerPC 64-le Details
teptris-0.2.21-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.21-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.21-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
teptris-0.2.21-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.21.tar.gz

Download URL teptris-0.2.21.tar.gz
Size 82.8 kB
Tags Source
SHA-256 checksum
How to use checksums
781a4aa92928e548573de1cbc18cb9d6a6dbc32001f1847e9c7160925d9e7e50
BLAKE2b-256 checksum
How to use checksums
db8063680746db7befe308766be8d3d359b12d77cf78b2987e8acbd6d8f039cc
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.21-cp39-abi3-win_arm64.whl

Download URL teptris-0.2.21-cp39-abi3-win_arm64.whl
Size 132.9 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
fa0405dfc9f7abdbdbe369082e84d5edd251c87174cae5467360b5e579b69a11
BLAKE2b-256 checksum
How to use checksums
133a6bdf6ceaed2fb2049ed0eb62cc7fd6ff958f0c1bb1e4d94ef49a0bee6933
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.21-cp39-abi3-win_amd64.whl

Download URL teptris-0.2.21-cp39-abi3-win_amd64.whl
Size 134.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
690611eae0842a163fca34210bcd6e69044d56b6b0ea5b4614d08151463e0c93
BLAKE2b-256 checksum
How to use checksums
6f5463c581ad4e0fe6b0dfc82d2171597f68ef82505179ca809ef6fd0678f22f
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.21-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL teptris-0.2.21-cp39-abi3-musllinux_1_2_x86_64.whl
Size 173.5 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
6b147286ad61de796b1e0d3573e2ed80e7b39c0b1d4a88feda88f5072df1137a
BLAKE2b-256 checksum
How to use checksums
a3c8239e0afb0ea634e82c6d179878d693c0a7bbf8cd11922c4e61c6f8bf25b0
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.21-cp39-abi3-musllinux_1_2_armv7l.whl

Download URL teptris-0.2.21-cp39-abi3-musllinux_1_2_armv7l.whl
Size 175.5 kB
Tags CPython 3.9 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
4abf9e0a800baaa774ae279f14dbecb65c7abc4c029dc55de27dce9997c656ec
BLAKE2b-256 checksum
How to use checksums
59907ab89a81138be264e0859252b48177fbd7ba7063985236ba083bfc2a7b57
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.21-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL teptris-0.2.21-cp39-abi3-musllinux_1_2_aarch64.whl
Size 179.1 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
7ae74919d06c83b3ed0333142e61d59bf95c543fef531fab2e82b5cdb526d43c
BLAKE2b-256 checksum
How to use checksums
4fcfc930d312901b6697ca6113cfdec94c61708cca1d9d5222bd26c2e4efabe4
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.21-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL teptris-0.2.21-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 171.3 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
1acc539bb40d331d63b9f6166fcdca263e5b576a0dc0fbc5f954a84af63c80e1
BLAKE2b-256 checksum
How to use checksums
9c11e0b0eec31c298530d9119ff89ed870677c1afa543045702c5af6a248ccb8
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.21-cp39-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl

Download URL teptris-0.2.21-cp39-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl
Size 175.8 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
89698caa8de5aab6c73242562bc4f6a636a92449414d36724d444feec24786b6
BLAKE2b-256 checksum
How to use checksums
ee8af01a752ad0df83584544903e1b995e865da44b8e22fac43f27b8a4213ff3
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.21-cp39-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl

Download URL teptris-0.2.21-cp39-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl
Size 183.3 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
0c4bd6ea337b6b4fad8c98c5d4a13ae92b623cc9bc09467e4818012aaa1240b4
BLAKE2b-256 checksum
How to use checksums
bd2c462e3cb463e54d3155b3eb9b3806f203356f8b717f630220d9d7e4c824e2
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.21-cp39-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl

Download URL teptris-0.2.21-cp39-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl
Size 178.5 kB
Tags CPython 3.9 Linux glibc 2.17+ ARMv7l Linux glibc 2.31+ ARMv7l abi3
SHA-256 checksum
How to use checksums
ba92c5b19ce03446a854ffdf7e8adf13a8364d82756a4a6a46015dfa4a3396f9
BLAKE2b-256 checksum
How to use checksums
1edcb4bb43a8bba273eb0d2d2c36c1f823d4cd74a5e484d7da9f42a15bf87792
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.21-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL teptris-0.2.21-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 177.8 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
11fa2f234acfe6cf85ed4d728ffd21985a9c6e1971523dabce5b545d870dff0e
BLAKE2b-256 checksum
How to use checksums
e440b62363a216b137eea1782dd629382cef9522534fc73fb888e63bee360108
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.21-cp39-abi3-macosx_11_0_arm64.whl

Download URL teptris-0.2.21-cp39-abi3-macosx_11_0_arm64.whl
Size 150.8 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
530adc0952d7e145ba96d47bb7afcde1ea61292781e27b4bc96ce90181ba5056
BLAKE2b-256 checksum
How to use checksums
619de162de4f95f4cab8f3b8782bd9b866cf1ed4b81f0cc2f0ea15c03e39de48
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.21-cp39-abi3-macosx_10_9_x86_64.whl

Download URL teptris-0.2.21-cp39-abi3-macosx_10_9_x86_64.whl
Size 150.3 kB
Tags CPython 3.9 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
4e86ffbd88a8cf8f45ba765a33a61619f5f449ea9eff3a59fdc8ab611da2b2e7
BLAKE2b-256 checksum
How to use checksums
04004bdda5ab2d742204a7aa9f483dba03d581cf21cd593cb78a9a16f46fcab6
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.21

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.21 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