Skip to main content

JSON to TOON Lite

A zero-dependency Python micro-tool that converts JSON into Token-Oriented Object Notation (TOON). TOON reduces LLM token usage by up to 60% by eliminating repetitive JSON keys in uniform arrays and rendering them as compact CSV-style tables.

Usage

from json_to_toon_lite import convert_json_to_toon

json_data = """
{
  "location": "Berlin",
  "alerts": ["frost", "wind"],
  "forecast": [
    {"day": "Mon", "temp": -2, "condition": "snow"},
    {"day": "Tue", "temp": 1, "condition": "cloudy"}
  ]
}
"""

print(convert_json_to_toon(json_data))

Output: (Massive Token Savings!)

location: Berlin
alerts[2]: frost,wind
forecast[2]{day,temp,condition}:
  Mon,-2,snow
  Tue,1,cloudy

Download files

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

Source Distribution

json_to_toon_lite-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

json_to_toon_lite-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file json_to_toon_lite-0.1.0.tar.gz.

File metadata

  • Download URL: json_to_toon_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for json_to_toon_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 917f3f58edbcf918c4bb64c040b85bfcb05e67573fc6977896c97ddbba2cb1e4
MD5 d4d68f2f2f8945950241dd085f473c15
BLAKE2b-256 90ba698f57f18e42e3f6bba714f4fc37b7134465e247a0cc18470331f34fefb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_to_toon_lite-0.1.0.tar.gz:

Publisher: publish.yml on Encephos/json-to-toon-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file json_to_toon_lite-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for json_to_toon_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e5748ff79f21d964100d70da9a3e3891506d5581d043f5ad218a1060c759e02
MD5 7b7c63f66d5377d2ebdf6c18b28efe29
BLAKE2b-256 900fe435c0f93e7933f0f529bd468321db5fcc72559629c71a3c671f3a1fdc8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_to_toon_lite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Encephos/json-to-toon-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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