Skip to main content

yeptris — YAML for Python at libleptris speed

An FFI-based (no C extension) YAML library over libyeptris — the YAML counterpart of libleptris. PyYAML-compatible semantics, one shared library, zero compilation at install.

Install (development)

# the sibling C checkout: ~/src/leptris/yeptris
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DYEPTRIS_BUILD_SHARED=ON
cmake --build build

cd ~/src/leptris/yeptris-py
YEPTRIS_LIB_PATH=../yeptris/build/src/libyeptris.dylib python3 -m pytest

Without YEPTRIS_LIB_PATH the loader falls back to a vendored yeptris/_platform/<tag>/ copy, then to the sibling checkout's build directory. Any libyeptris.{so,dylib,dll} path works.

Usage

import yeptris
from yeptris import yaml  # PyYAML-compatible surface

yaml.safe_load("name: yeptris\nrating: 10\n")
# {'name': 'yeptris', 'rating': 10}

yaml.safe_load_all("--- 1\n--- two\n")   # [1, 'two']
yaml.safe_dump({"b": 2, "a": [1, "x"]})  # 'a:\n  - 1\n  - x\nb: 2\n'

yeptris.load("k: v")        # the neutral surface
yeptris.dump({"k": [1, 2]})

Typing follows PyYAML's SafeLoader (YAML 1.1 implicit typing): yes/no/on/off booleans, 0x/leading-0/0b/sexagesimal integers, dot-required floats, timestamps with offsets, merge keys, anchor identity. Every deliberate divergence is pinned by a test.

Design

One parse, one bulk drain: the record array and string arena are read in two FFI calls, then a pure-Python walk over the unpacked records — the FFI tax is O(1) per document, never per event (the same seam yeptris-ruby rides). The 36-byte record layout is ABI-pinned in the C header and mirrored in _ffi.py.

Performance

python3 bench.py — same-process comparison against PyYAML (pure) and CSafeLoader/CDumper (libyaml C extensions):

  • load: 28-39x PyYAML pure, 3.8-6.1x CSafeLoader
  • dump: ~1.7x PyYAML pure, ~2x behind CDumper (which walks the tree entirely in C — a no-C-extension design's ceiling is the Python walk itself; the tree raises through ONE yeptris_document_build call)

Both directions are O(chunks) in FFI calls: loads drain records in two calls, dumps build through one flat entry array.

JSON (strict RFC 8259) — yeptris.json

yeptris.json.loads is json.loads-compatible (values, rejects, types, json.JSONDecodeError — including stdlib's default NaN/ Infinity constant quirk) with two engines behind one contract:

  • native — the opt-in extension ext/yeptris_native.c: a fused scan-kernel descent over libyeptris (the same shape as the Ruby binding's materializer), with a 1024-slot interned-free key cache. Build it with YEPTRIS_LIB_PATH + YEPTRIS_SRC set (python3 setup.py build_ext --inplace); CI builds and gates it.
  • strict-ffi — the default pure path: yeptris_parse_json is the validator gate, then the columnar value walk converts under JSON rules. No C extension, correct everywhere.

benchmark/json_profile.py is the referee (order-alternating interleave vs the C scanner): the native engine runs 0.67-0.87x json.loads mean (83-85% head-to-head) on the 144 KB reference corpus; shape decomposition: int arrays 0.63x, float arrays 0.77x, long strings 0.85x, unique-key maps 0.95x. The previous pure walk was ~15x BEHIND — the fused materializer is the entire gap.

Installing the native JSON engine (platform wheels)

pip install yeptris on macOS (arm64) and manylinux (x86_64) installs platform wheels that vendor libyeptris and the native JSON materializer (abi3 — one wheel per platform serves CPython 3.9+): zero compiler, zero env vars, yeptris.json.engine() is native out of the box. Every wheel is release-smoked in a clean venv before publish. Other platforms install the pure package (the strict-ffi JSON engine + YAML via libyeptris through the YEPTRIS_LIB_PATH ladder); building the extension from source is YEPTRIS_LIB_PATH=... YEPTRIS_SRC=... python3 setup.py build_ext --inplace.

Metadata

Release files for yeptris 0.6.32.1

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

Source distribution (sdist)

Source distribution for yeptris 0.6.32.1
File Size Uploaded
yeptris-0.6.32.1.tar.gz 304.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for yeptris 0.6.32.1
File
yeptris-0.6.32.1-py3-none-any.whl Python 3 none any Details
yeptris-0.6.32.1-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
yeptris-0.6.32.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
yeptris-0.6.32.1-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
yeptris-0.6.32.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
yeptris-0.6.32.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
yeptris-0.6.32.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
yeptris-0.6.32.1-cp39-abi3-macosx_11_0_x86_64.whl CPython 3.9 abi3 macOS 11.0+ x86-64 Details
yeptris-0.6.32.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 8.5 MB

Release files / yeptris-0.6.32.1.tar.gz

Download URL yeptris-0.6.32.1.tar.gz
Size 304.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a4e7efbf9f9f1a81edb6228ef448246d084aeacd181ca2ec339f7c99ee188f88
BLAKE2b-256 checksum
How to use checksums
a2a920accb7964f0296e273531bbf4cfd13e78f4c47502a0e00860d6da7f0675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-py3-none-any.whl

Download URL yeptris-0.6.32.1-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1a497b85e62bf1ef564298572934b07ac7d27f101d17dd15dd1bf2f38c34d48
BLAKE2b-256 checksum
How to use checksums
0c1a1a01309119b2a095ff957b4febe05c34a0b7c4782a8bf671ab3368495230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-win_arm64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-win_arm64.whl
Size 883.1 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
3b6243c09930a178295cd4f48b2ca3ea732148e88f767aafdb56ce07b63417f5
BLAKE2b-256 checksum
How to use checksums
fcec0ba058d1bced07721724ff24ead8a6c3565bae63ee0038beb58ea8d656b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-win_amd64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-win_amd64.whl
Size 893.3 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
717ef971cb8d7fb33541649db83a46d006b569eceead564500ed3efd2996abff
BLAKE2b-256 checksum
How to use checksums
968ef83175050f4b0a962866c1ddd9ef2657461179ce42447ee9e1634fa4b572
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
028f35c97541eaee75525458e31e17f1bdab8afade7597e509593f158c197f8d
BLAKE2b-256 checksum
How to use checksums
67d31cea42a8bb855c933c282aacc284f1edbbb0074dbcaf3babc2ee4a63d2fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
7804afc5a1dcdb23dbe447275f70415c03954e76d330ab13c5d348cf946b212d
BLAKE2b-256 checksum
How to use checksums
35f19a73f2742833c92a0ce6c897935f81f7a6c4ccd1c0400cf9af1e2f9b8889
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 992.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e61aed3eb41dfc9c6b4e4e67b058dec25eacc9d5773895cee8a987a12993c85c
BLAKE2b-256 checksum
How to use checksums
e677cabf5dae2ab8426e7b7a2aedda4d9d2476f7f55ae9852052f70d97316a33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 993.1 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6b0ece90a47c58e2e986ad40befc04b9fcda3472d13eb047ce8bf716067f0abb
BLAKE2b-256 checksum
How to use checksums
352521cf684b2a1cae05d70075cd2a74579eace8954bb954113a37ae9d82145f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-macosx_11_0_x86_64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-macosx_11_0_x86_64.whl
Size 951.4 kB
Tags CPython 3.9 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
50df7f206dc79fb836f9afdee003c7aead9b0790e010ee91abb81ffe11f8efc4
BLAKE2b-256 checksum
How to use checksums
91df1d3c2c69520447e413a810385d1c072a74cdf04e8f2d279e344cf9ff7512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / yeptris-0.6.32.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL yeptris-0.6.32.1-cp39-abi3-macosx_11_0_arm64.whl
Size 927.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
12e0d0ceb45969747e40b542a206bea423fa2fb7708d670056e82e95f634c621
BLAKE2b-256 checksum
How to use checksums
b83a9cb9fb6ceab8c09f124abb85b3da704e24a1f6b48c0f66645e56dd503f17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.32.1 This release

10 release files

0.1.0

2 release files

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