skillfed

toon-format

Token-Oriented Object Notation – a token-efficient JSON alternative for LLM prompts

toon-format v0.1.0 548.3K downloads/30d#6,065 on PyPI757
Permissive license MIT Active released

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-format

uv

uv add toon-format

poetry

poetry add toon-format

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules

Tags

token-efficient data formatllm prompt serializationcompact json alternativetoon format encoder decoderreduce tokens in prompts
llm-optimizationserializationtoken-efficiency

More Python Modules packages