Skip to main content

ZOON - Zero Overhead Object Notation for LLM context optimization

Project description

ZOON Python

ZOON - Zero Overhead Object Notation

A Python implementation of the ZOON format for LLM context optimization. Achieves ~60% token reduction compared to JSON while maintaining 100% data fidelity.

PyPI License

Installation

pip install zoon-format

Or with uv:

uv add zoon-format

Quick Start

import zoon

data = [
    {"id": 1, "name": "Alice", "role": "admin", "active": True},
    {"id": 2, "name": "Bob", "role": "user", "active": True},
    {"id": 3, "name": "Carol", "role": "user", "active": False},
]

encoded = zoon.encode(data)
print(encoded)
# # id:i+ name:s role=admin|user active:b
# Alice admin 1
# Bob user 1
# Carol user 0

decoded = zoon.decode(encoded)
assert decoded == data

Features

  • ~60% Token Reduction: Reduced LLM context usage vs JSON
  • 100% Lossless: Perfect round-trip encoding/decoding
  • Type-Safe: Preserves integers, floats, booleans, nulls, and strings
  • Auto-Increment IDs: i+ columns are omitted from data rows
  • Smart Enums: Automatic header-based typing for repeated values

API Reference

zoon.encode(data: Any) -> str

Encode Python data to ZOON format.

zoon.decode(zoon_string: str) -> Any

Decode ZOON string back to Python data.

License

MIT License. © 2025-PRESENT Carsen Klock

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zoon_format-1.0.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zoon_format-1.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file zoon_format-1.0.0.tar.gz.

File metadata

  • Download URL: zoon_format-1.0.0.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for zoon_format-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f6729b42953dba4f3b99e33c61ac626e4ddff2007f3476cc7ac924090fc2daa4
MD5 d5846c4285412204e9eb8b4b4ce8dd22
BLAKE2b-256 4e02ace79ae3230aa34dc8761b88167fb1a5da2354c49364badd9f38707f1546

See more details on using hashes here.

File details

Details for the file zoon_format-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zoon_format-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 616246f07199ef5c4f7b6d3d38b572ee0bf1398d221bb604efa37e057b4e4c4f
MD5 d4a00010f915d2cf8af87375858c25f2
BLAKE2b-256 9ae3bb08c08d5f806b0367307387651753ec04dc15c0e3573e7faf5aacd3bb29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page