toons
A high-performance TOON (Token Oriented Object Notation) parser and serializer for Python, implemented in Rust.
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you work with LLMs and need to reduce token consumption in serialized data—the token savings (30-60% vs JSON) are real and the json-like API lowers adoption friction. Verify the license (marked unclear in metadata despite Apache 2.0 in the description) before use in proprietary code. Medium install friction is acceptable for most modern Python environments, and the package is actively maintained with no known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.7; binary wheels available for modern x86_64, aarch64, and ARM64 platforms, but older or less common architectures may require a Rust compiler to build from source.
- Medium install friction due to compiled Rust bindings, but wheels are available for modern Python on common platforms (cp37-abi3 and cp314 variants for x86_64, aarch64, and ARM64).
- Package is actively maintained with recent commits and no known vulnerabilities.
License · maintenance · safety
(unclear) — License treatment is unclear—the description excerpt mentions Apache License 2.0, but the fact sheet records license_spdx and license_raw as null with treatment marked unclear. Verify the actual license before relying on this package in proprietary or restricted contexts.
last release 2026-05-21 (85 days) · last repo commit 2026-05-21 · 21 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,894,093 downloads/mo, #1,684 on PyPI
Alternatives
Verify before relying
pip install toons
import toons
data = toons.loads("name: Alice\nage: 30")
print(data) # {'name': 'Alice', 'age': 30}
user = {"name": "Bob", "age": 25}
print(toons.dumps(user))- Actual license SPDX identifier and full license text (description says Apache 2.0 but metadata is null).
- Real-world performance gains and token reduction percentages on typical LLM workloads beyond the documented 30-60% range.
- Stability and breaking-change history across minor versions since first release in 2025-11-01.
What it is and what it does
toons is a Python library that parses and serializes data in TOON format, a compact token-efficient notation designed to reduce token consumption in LLM contexts by 30-60% compared to JSON. It wraps a Rust implementation via PyO3 bindings and exposes a json-like API (loads, dumps, load, dump) so developers familiar with the standard library can adopt it with minimal friction. The package also includes conversion utilities to translate between TOON and JSON.
The library targets use cases where token count directly impacts cost or context capacity—primarily LLM applications, prompt engineering, and data serialization for AI systems. It supports standard Python types and is spec-compliant with TOON Specification v3.0. Installation is straightforward on modern platforms via prebuilt wheels, though some architectures may require a Rust compiler.
Use it for
- Reduce token consumption in LLM prompts and responses by serializing structured data in TOON instead of JSON.
- Build prompt templates and few-shot examples that fit within tighter token budgets for cost-sensitive LLM APIs.
- Convert between TOON and JSON formats in data pipelines serving both LLM and non-LLM consumers.
- Store and transmit structured configuration or metadata in LLM-adjacent workflows where token efficiency matters.
- Prototype or migrate existing json-based code to TOON with minimal refactoring due to the familiar API.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you work with LLMs and need to reduce token consumption in serialized data—the token savings (30-60% vs JSON) are real and the json-like API lowers adoption friction. Verify the license (marked unclear in metadata despite Apache 2.0 in the description) before use in proprietary code. Medium install friction is acceptable for most modern Python environments, and the package is actively maintained with no known vulnerabilities.
Install
toons on PyPI
Before you install
Medium install friction due to compiled Rust bindings, but wheels are available for modern Python on common platforms (cp37-abi3 and cp314 variants for x86_64, aarch64, and ARM64). Package is actively maintained with recent commits and no known vulnerabilities.
Requires Python >=3.7; binary wheels available for modern x86_64, aarch64, and ARM64 platforms, but older or less common architectures may require a Rust compiler to build from source.
License in practice
License treatment is unclear—the description excerpt mentions Apache License 2.0, but the fact sheet records license_spdx and license_raw as null with treatment marked unclear. Verify the actual license before relying on this package in proprietary or restricted contexts.
Quickstart
pip install toons
import toons
data = toons.loads("name: Alice\nage: 30")
print(data) # {'name': 'Alice', 'age': 30}
user = {"name": "Bob", "age": 25}
print(toons.dumps(user))
Verify before relying
- Actual license SPDX identifier and full license text (description says Apache 2.0 but metadata is null).
- Real-world performance gains and token reduction percentages on typical LLM workloads beyond the documented 30-60% range.
- Stability and breaking-change history across minor versions since first release in 2025-11-01.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 85 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,894,093 / month, #1,684 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Rust |
Evidence: toons-0.7.0-cp314-cp314t-macosx_10_12_x86_64.whl; toons-0.7.0-cp314-cp314t-macosx_11_0_arm64.whl; toons-0.7.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; toons-0.7.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; toons-0.7.0-cp314-cp314t-musllinux_1_2_aarch64.whl; toons-0.7.0-cp314-cp314t-musllinux_1_2_x86_64.whl; toons-0.7.0-cp314-cp314t-win_amd64.whl; toons-0.7.0-cp314-cp314t-win_arm64.whl; toons-0.7.0-cp37-abi3-macosx_10_12_x86_64.whl; toons-0.7.0-cp37-abi3-macosx_11_0_arm64.whl; toons-0.7.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; toons-0.7.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; toons-0.7.0-cp37-abi3-musllinux_1_2_aarch64.whl; toons-0.7.0-cp37-abi3-musllinux_1_2_x86_64.whl; toons-0.7.0-cp37-abi3-win_amd64.whl; toons-0.7.0-cp37-abi3-win_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “TOON format parser serializer”
- toonstoons is a Rust-backed Python parser and serializer for the TOON…
- python-toonEncodes and decodes TOON (Token-Oriented Object Notation), a compact…
- toon-formatEncodes and decodes data structures using TOON (Token-Oriented Object…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also python-toon · toon-format · json-tools-rs · toml-rs · fastokens · json-flatten · json-stream-rs-tokenizer · typed-json-dataclass · canoser