Skip to main content

tson-bin — Terse JSON binary format for Python

PyPI License: MIT

TSON is a compact, schema-deduplicated binary format for JSON — field names are stored once, repeated strings are interned, giving 60–70% size reduction on repetitive data (API payloads, telemetry, config). These are the Python bindings (a native extension built in Rust via PyO3).

The PyPI distribution is tson-bin but it imports as tson.

Install

pip install tson-bin
import tson

Usage

import tson

# Compile a JSON string to TSON binary, and back
blob = tson.dumps('{"name": "Alice", "age": 30}')   # -> bytes
obj  = tson.loads(blob)                               # -> {"name": "Alice", "age": 30}

# Encode a Python object directly (no JSON string in between)
blob = tson.emit({"temp": 22.5, "status": "nominal"})

# File I/O
tson.dump('{"msg": "hello"}', "message.tson")
obj = tson.load("message.tson")

API

Function Signature Description
dumps(json_text) str -> bytes Compile a JSON string to TSON binary
loads(blob) bytes -> object Decode TSON binary to a Python object
dump(json_text, path) (str, str) -> None Compile a JSON string to a .tson file
load(path) str -> object Read and decode a .tson file
emit(obj) object -> bytes Encode a Python object directly to TSON

Invalid input raises ValueError.

Documentation

License

MIT © SIKTEC Lab

Metadata

Release files for tson-bin 0.1.4

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

Built distributions (wheels)

Table of built distributions (wheels) for tson-bin 0.1.4
File Actions
tson_bin-0.1.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for tson_bin-0.1.4-cp312-cp312-win_amd64.whl
tson_bin-0.1.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for tson_bin-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
tson_bin-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for tson_bin-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl
tson_bin-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for tson_bin-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Total release size: 1.0 MB

Release files / tson_bin-0.1.4-cp312-cp312-win_amd64.whl

Download URL tson_bin-0.1.4-cp312-cp312-win_amd64.whl
Size 172.6 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c6492b41b5efcfa74ab504064e007028b30c534902c64538840367bfae557fc2
BLAKE2b-256 checksum
How to use checksums
efa2a27d520be73e73d282f1eb67e0c36ca1160bf41f122748e362ac83dd97db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release files / tson_bin-0.1.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL tson_bin-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Size 260.5 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7360946dede653ad939f58139c29ca9f541ae1f8292797a1d43e650b8b3d784d
BLAKE2b-256 checksum
How to use checksums
2c8720acf2cf01504e980afac85e37f0d923caf4fa6ea63d3e3407e7436a6221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release files / tson_bin-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl

Download URL tson_bin-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl
Size 279.0 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
cb3f16694357b54a2f2b2e8addd5bcc853b83414766d8a766290e77486b08cec
BLAKE2b-256 checksum
How to use checksums
59488c0a1482963978c475ff7d984d860cc9abb24f23448295ec529a31ae23f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release files / tson_bin-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tson_bin-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 293.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cb1bf598c34b8f42bf76432c64af3b09397f70beaef1182f515a2825fd7a5a6d
BLAKE2b-256 checksum
How to use checksums
c39628aa47a7f96f33b0c0aec825f289266334e8b18e63e0d8a370e18beee1c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Security for tson-bin 0.1.4

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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for tson_bin-0.1.4-cp312-cp312-win_amd64.whl

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 Jun 22, 2026.

Transparency log

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.

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