Skip to main content

triepack

Compressed trie dictionary format (.trp) — compact binary key-value storage with fast lookups and prefix search.

This is the native Python implementation: pure Python, no dependencies, no C extension to build. It reads and writes the same bytes as the C reference library and the JavaScript, Go, Rust, Swift, Java and Kotlin implementations.

Install

pip install triepack

Use

from triepack import encode, decode

buf = encode({"hello": 42, "world": "foo"})
# buf is bytes holding the .trp binary

result = decode(buf)
print(result)  # {'hello': 42, 'world': 'foo'}

Values

Python .trp type
None null
bool bool
int >= 0 uint
int < 0 int
float float64
str string (UTF-8)
bytes blob

Decoding also accepts float32 values written by other implementations, widening them to a Python float. Python integers are arbitrary precision, so the full 64-bit signed and unsigned ranges round-trip exactly.

Format

Every buffer carries a 32-byte header, a bit-packed prefix trie, a typed value store and a CRC-32. Keys are stored once per shared prefix, and symbols are packed at the minimum width the key alphabet needs.

The encoder is deterministic: the same input produces the same bytes in every implementation, which is checked by a shared conformance suite that all nine implementations run.

Development

cd bindings/python
pip install -e ".[test]"
python -m pytest

License

Copyright (c) 2026 M. A. Chatterjee. BSD-2-Clause — see LICENSE.txt.

Release files for triepack 1.3.2

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

Source distribution (sdist)

Source distribution for triepack 1.3.2
File Size Uploaded
triepack-1.3.2.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for triepack 1.3.2
File Interpreter ABI Platform
triepack-1.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.4 kB

Release files / triepack-1.3.2.tar.gz

Download URL triepack-1.3.2.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cba033f2e012bbedae372f32d43fb7b97f05333e1682136dce7ad618f203eeea
BLAKE2b-256 checksum
How to use checksums
5e2e6c47d6418a9d5aed2e984dae83c5aa9a79a24a2dff28beca03b20afda788
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 Sep 17, 2026.

Transparency log

Release files / triepack-1.3.2-py3-none-any.whl

Download URL triepack-1.3.2-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e504ad09488054c5cfddec07ab7957ce90981253b33b9f5bf1557d3fc8dd6c21
BLAKE2b-256 checksum
How to use checksums
6fba5ce413b546e5ecbadda43b4900d4b9ffb2ec9c4c3a2eabc3c4bc91212f56
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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

This release

1.3.2 This release

2 release files

1.3.1

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