Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

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.

PyPILicense

Installation

pip install zoon-format

Or with uv:

uv add zoon-format

Quick Start

importzoondata= [
{"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 0decoded=zoon.decode(encoded)
assertdecoded==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

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages