Your First Conversion
Convert JSON to TOON
Run the converter:This creates
example.toon with the following content:example.toon
Notice how the array
[95, 87, 92] is represented as scores[3]: 95,87,92 - the [3] indicates the array length.Tabular Data Example
TOON format excels at representing tabular data. Here’s how arrays of objects are handled:The header
users[3]{id,name,role}: tells the parser:[3]- array has 3 items{id,name,role}- each object has these fields in this order- Data rows follow with comma-separated values
Batch Conversion
JSONL to Multiple TOON Files
Convert a JSONL (JSON Lines) file where each line is a separate JSON object:toon_output/ with files like:
data_0000.toondata_0001.toondata_0002.toon
Folder of TOON Files to JSONL
Convert multiple TOON files back to a single JSONL file:Conversion Options
Customize your conversions with command-line options:Encoding Options (JSON → TOON)
Decoding Options (TOON → JSON)
Using in Python Code
You can also use the converter programmatically:Direct Encoding/Decoding
For working with data in memory:Common Patterns
Primitive Arrays
Arrays of simple values (strings, numbers, booleans) are written inline:Nested Objects
Objects can be nested naturally:List of Objects
Arrays containing non-uniform objects or nested structures:Next Steps
CLI Options
Explore all encoding and decoding options
TOON Format
Learn the TOON format specification
API Reference
Browse the complete API documentation
Examples
See more real-world examples