Battling JSON bloat with Pythonic elegance. A high-efficiency TOON serializer.
Project description
"First, we shape our tools, thereafter they shape us."
Deccan Toon is a strict, high-velocity implementation of the TOON v3.0 Specification.
While other parsers focus on flexibility, Deccan Toon focuses on correctness, security, and type fidelity. We built this to be the "Newtonsoft" of the TOON ecosystem—robust enough for enterprise agents and critical infrastructure.
📉 Token Economics (The "Why")
Standard JSON repeats keys for every single row (id, name, status), wasting precious context window space in LLMs (GPT-4, Claude). TOON sends the header once.
Payload Size Comparison (1000 items):
████████████████████ 100% - JSON (Standard)
████████████ 60% - CSV (No types)
███████████ 55% - TOON (Typed & Clean)
Stop paying for repeated keys. Save context window space for actual intelligence.
📦 Installation
pip install deccan-toon
⚡ Quick Start
import deccan_toon
# 1. Define your data (List of Dicts)
data = [
{"id": 1, "agent": "Alpha", "status": "Active", "score": 0.98},
{"id": 2, "agent": "Beta", "status": "Idle", "score": None},
{"id": 3, "agent": "Gamma", "status": "Sleep", "score": 0.45}
]
# 2. Serialize (Python -> TOON)
payload = deccan_toon.dumps(data)
print(payload)
# Output:
# items[3]{id,agent,status,score}:
# 1, Alpha, Active, 0.98
# 2, Beta, Idle, null
# 3, Gamma, Sleep, 0.45
# 3. Deserialize (TOON -> Python)
restored = deccan_toon.loads(payload)
🛡️ The Deccan Difference
-
Strict Compliance: Fully compliant with TOON v3.0 (Handling nesting, typed arrays, and sparse data).
-
Security First: Includes protections against "Billion Laughs" expansion attacks and deep recursion.
-
Type Safety: Unlike CSV, we preserve int, float, bool, and null types with 100% fidelity.
-
Zero Dependencies: Runs on pure Python standard library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deccan_toon-0.2.0.tar.gz.
File metadata
- Download URL: deccan_toon-0.2.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0812d3ba5dbba266f021730cc5f87d3562d798ef0d1c4a4d974f19f2cab8611c
|
|
| MD5 |
e7703d9a02d0495b41478610406429b2
|
|
| BLAKE2b-256 |
57e30af1345b5d90e0364f44112cdca7748f634f81581c570c4f90e09a6baf9e
|
File details
Details for the file deccan_toon-0.2.0-py3-none-any.whl.
File metadata
- Download URL: deccan_toon-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
913c06f448809d7b5322e04c7f0973a62284e5a841fa09f0f14ebd622ffaf248
|
|
| MD5 |
9706c45522cf3e7459bf646c5d44cc49
|
|
| BLAKE2b-256 |
da4ac86194ddadba6014aa153f0157ee65a245db0f59efafec459803f211ada2
|