toon-format
Token-Oriented Object Notation – a token-efficient JSON alternative for LLM prompts
What it is and what it does
TOON Format is a Python implementation of Token-Oriented Object Notation, a serialization format that compresses structured data into a more compact representation than JSON. It is designed specifically for reducing token consumption when sending data to language models, where token count directly affects cost and latency. The format uses a column-oriented syntax that eliminates redundant key names and whitespace, allowing the same data to fit in fewer tokens.
The package provides encode() and decode() functions to convert between Python data structures and TOON strings. However, the current release (0.1.0) is marked as a namespace reservation, meaning the core implementation is not yet complete. It supports Python 3.10 through 3.14 and has no external runtime dependencies, making installation straightforward once the implementation is ready.
Use it for:
- Reduce token count in LLM API calls by encoding structured data in TOON format before sending prompts.
- Serialize configuration or metadata objects for embedding in language model contexts with minimal overhead.
- Convert between JSON and TOON formats to optimize data passed to AI systems where token budgets are constrained.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes data structures using TOON (Token-Oriented Object Notation), a compact format designed to reduce token usage when passing structured data to language models.
No, not yet. The package is currently a namespace reservation with full implementation pending. While the concept is sound and the MIT license is permissive, installing 0.1.0 will not provide working encode/decode functions. Wait for a later release that completes the implementation before adopting this package.
Install
toon-format on PyPI
pip
pip install toon-formatuv
uv add toon-formatpoetry
poetry add toon-formatInstalling toon-format
Before you install
Low friction install with no runtime dependencies. The package is actively maintained and supports modern Python versions (3.10–3.14), though it is currently in alpha status and marked as a namespace reservation with full implementation pending.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install toon-format
from toon_format import encode, decode
data = {"users": [{"id": 1, "name": "Alice"}]}
toon_string = encode(data)
decoded = decode(toon_string)
Requires Python 3.10 or later; package is currently in alpha and full implementation is not yet complete.
Verify before relying
- Whether encode() and decode() functions are currently implemented or if the package is still a placeholder.
- Performance benchmarks comparing token reduction versus JSON for typical LLM use cases.
- Compatibility with specific LLM APIs or frameworks beyond the general use case.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 286 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 548,263/month — #6,065 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: toon_format-0.1.0-py3-none-any.whl
Keywords: toon, serialization, llm, data-format, token-efficient
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
python-toonEncodes and decodes TOON (Token-Oriented Object…
permissive · top 15,000 on PyPI
toonstoons is a Rust-backed Python parser and…
unclear · top 5,000 on PyPI
doclangDocLang is a reference toolkit for validating…
permissive · top 5,000 on PyPI
py-ubjsonEncodes and decodes data in Universal Binary…
permissive · top 5,000 on PyPI
dataclasses-jsonConverts Python dataclasses to and from JSON…
permissive · top 1,000 on PyPI
banksBanks is a template language and prompt…
permissive · top 5,000 on PyPI
simplejsonsimplejson encodes Python objects to JSON and…
permissive · top 1,000 on PyPI
json-flattenConverts nested JSON objects into flat…
permissive · top 15,000 on PyPI
dataclasses-json-speakeasyConverts Python dataclasses to and from JSON…
permissive · top 5,000 on PyPI
avroApache Avro is a data serialization system that…
permissive · top 5,000 on PyPI