Skip to content

maheshvaikri-code/ison

Repository files navigation

ISON Logo

A minimal, token-efficient data format optimized for LLMs and Agentic AI workflows.

Version 1.0.1 License: MIT NPM PyPI Crates.io

Author: Mahesh Vaikri


ISON (Interchange Simple Object Notation) is a minimal data interchange format optimized for Large Language Models. It is easy for humans to read and write. It is easy for LLMs to understand and generate. It is based on familiar tabular and relational patterns that language models have seen billions of times in training data.

ISON is a text format that is completely language independent but represents data in a way that maximizes token efficiency and minimizes cognitive load for AI systems. These properties make ISON an ideal data interchange format for AI and LLM workflows.


Why ISON?

ISON reduces token usage by 30-70% compared to JSON while remaining human-readable and LLM-friendly.

JSON (87 tokens)                    ISON (34 tokens)
─────────────────                   ─────────────────
{                                   table.users
  "users": [                        id:int name:string email active:bool
    {                               1 Alice alice@example.com true
      "id": 1,                      2 Bob bob@example.com false
      "name": "Alice",              3 Charlie charlie@example.com true
      "email": "alice@example.com",
      "active": true
    },
    {
      "id": 2,
      "name": "Bob",
      "email": "bob@example.com",
      "active": false
    },
    {
      "id": 3,
      "name": "Charlie",
      "email": "charlie@example.com",
      "active": true
    }
  ]
}

Perfect for:

  • Multi-agent systems
  • RAG pipelines
  • Graph databases
  • Token-constrained AI/ML, LLM, Agentic AI workflows
  • LLM function calling

Quick Start

Installation

JavaScript/TypeScript:

npm install ison-parser    # JavaScript
npm install ison-ts        # TypeScript with full types
npm install isonantic-ts   # Validation & schemas

Python:

pip install ison-py        # Parser
pip install isonantic      # Validation & schemas

Rust:

[dependencies]
ison-rs = "1.0"
isonantic-rs = "1.0"       # Validation & schemas

C++ (Header-only):

# Just copy the header
cp ison-cpp/include/ison_parser.hpp /your/project/

Go:

go get github.com/maheshvaikri-code/ison/ison-go
go get github.com/maheshvaikri-code/ison/isonantic-go

Usage Examples

JavaScript:

import { parse, dumps, toJSON } from 'ison-parser';

const doc = parse(`
table.users
id:int name:string active:bool
1 Alice true
2 Bob false
`);

console.log(doc.users.rows);
// [{ id: 1, name: 'Alice', active: true }, ...]

console.log(toJSON(doc));
// Standard JSON output

Python:

from ison_py import parse, dumps, to_json

doc = parse("""
table.users
id:int name:string active:bool
1 Alice true
2 Bob false
""")

for row in doc['users']['rows']:
    print(f"{row['id']}: {row['name']}")

# Convert to JSON
print(to_json(doc))

Rust:

use ison_rs::{parse, dumps};

let doc = parse(r#"
table.users
id:int name:string active:bool
1 Alice true
2 Bob false
"#)?;

let users = doc.get("users").unwrap();
for row in &users.rows {
    let name = row.get("name").and_then(|v| v.as_str()).unwrap();
    println!("{}", name);
}

C++:

#include "ison_parser.hpp"

auto doc = ison::parse(R"(
table.users
id:int name:string active:bool
1 Alice true
2 Bob false
)");

for (const auto& row : doc["users"].rows) {
    std::cout << ison::as_string(row.at("name")) << std::endl;
}

Go:

import "github.com/maheshvaikri-code/ison/ison-go"

doc, _ := ison.Parse(`
table.users
id:int name:string active:bool
1 Alice true
2 Bob false
`)

users, _ := doc.Get("users")
for _, row := range users.Rows {
    name, _ := row["name"].AsString()
    fmt.Println(name)
}

ISON Format

# Comments start with #

table.users                        # Block: kind.name
id:int name:string email active:bool   # Fields with optional types
1 Alice alice@example.com true     # Data rows (space-separated)
2 "Bob Smith" bob@example.com false    # Quoted strings for spaces
3 ~ ~ true                         # ~ or null for null values

table.orders
id user_id product
1 :1 Widget                        # :1 = reference to id 1
2 :user:42 Gadget                  # :user:42 = namespaced reference

object.config                      # Single-row object block
key value
debug true
---                                # Summary separator
count 100                          # Summary row

ISONL (Streaming Format)

For large datasets, use line-based ISONL where each line is self-contained:

table.users|id name email|1 Alice alice@example.com
table.users|id name email|2 Bob bob@example.com

Packages

Ecosystem Parser Validation Status
NPM ison-parser isonantic-ts 33 + 46 tests
NPM ison-ts - 23 tests
PyPI ison-py isonantic 31 + 39 tests
Crates.io ison-rs isonantic-rs 9 + 1 tests
C++ ison-cpp isonantic-cpp 30 tests
Go ison-go isonantic-go 28 + 55 tests

Total: 11 packages across 5 ecosystems, 303+ tests passing


Features

Feature Description
Tables Structured data with typed columns
Objects Single-row key-value blocks
References :id, :type:id, :RELATIONSHIP:id
Type Annotations field:int, field:string, field:bool, field:float
Computed Fields field:computed for derived values
ISONL Streaming Line-based format for large datasets
JSON Export Convert ISON to JSON
Roundtrip Parse and serialize without data loss

Schema Validation (ISONantic)

Type-safe validation with fluent API:

// JavaScript/TypeScript
import { table, string, int, boolean } from 'isonantic-ts';

const userSchema = table('users')
  .field('id', int().required())
  .field('name', string().min(1).max(100))
  .field('email', string().email())
  .field('active', boolean().default(true));

const users = userSchema.validate(doc);
# Python
from isonantic import table, string, int_, boolean

user_schema = (table('users')
    .field('id', int_().required())
    .field('name', string().min(1).max(100))
    .field('email', string().email())
    .field('active', boolean().default(True)))

users = user_schema.validate(doc)

Documentation


Project Structure

ison/
β”œβ”€β”€ ison-js/               # JavaScript parser (NPM: ison-parser)
β”œβ”€β”€ ison-ts/               # TypeScript parser (NPM: ison-ts)
β”œβ”€β”€ isonantic-ts/          # TypeScript validation (NPM: isonantic-ts)
β”œβ”€β”€ ison-py/               # Python parser (PyPI: ison-py)
β”œβ”€β”€ isonantic/             # Python validation (PyPI: isonantic)
β”œβ”€β”€ ison-rust/             # Rust parser (Crates.io: ison-rs)
β”œβ”€β”€ isonantic-rust/        # Rust validation (Crates.io: isonantic-rs)
β”œβ”€β”€ ison-cpp/              # C++ header-only parser
β”œβ”€β”€ isonantic-cpp/         # C++ header-only validation
β”œβ”€β”€ ison-go/               # Go parser
β”œβ”€β”€ isonantic-go/          # Go validation
β”œβ”€β”€ benchmark/             # Token efficiency benchmarks
β”œβ”€β”€ images/                # Logo and assets
β”œβ”€β”€ LICENSE                # MIT License
└── README.md              # This file

Development

# Clone the repository
git clone https://github.com/maheshvaikri-code/ison.git
cd ison

# JavaScript/TypeScript
cd ison-js && npm install && npm test
cd ison-ts && npm install && npm test
cd isonantic-ts && npm install && npm test

# Python
cd ison-py && pip install -e . && pytest
cd isonantic && pip install -e . && pytest

# Rust
cd ison-rust && cargo test
cd isonantic-rust && cargo test

# C++
cd ison-cpp && mkdir build && cd build && cmake .. && cmake --build . && ctest

# Go
cd ison-go && go test -v ./...
cd isonantic-go && go test -v ./...

Test Results

Click to expand test results (303+ tests passing)

JavaScript (ison-parser) - 33 tests

βœ“ parses basic table correctly
βœ“ handles quoted strings
βœ“ preserves type annotations
βœ“ handles references
βœ“ parses multiple tables
βœ“ converts to JSON correctly
βœ“ handles null values
βœ“ handles empty values in rows
βœ“ handles ISONL format

TypeScript (ison-ts) - 23 tests

βœ“ should parse basic table
βœ“ should handle quoted strings
βœ“ should preserve type annotations
βœ“ should handle references
βœ“ should parse multiple tables
βœ“ should convert to JSON
βœ“ should handle null values
βœ“ should handle empty values
βœ“ should parse ISONL format

TypeScript Validation (isonantic-ts) - 46 tests

βœ“ validates required string fields
βœ“ validates optional string fields
βœ“ validates string min/max length
βœ“ validates email format
βœ“ validates int/float/bool fields
βœ“ validates references
βœ“ validates table schemas
... and 39 more tests

Python (ison-py) - 31 tests

βœ“ test_parse_basic_table
βœ“ test_parse_quoted_strings
βœ“ test_parse_type_annotations
βœ“ test_parse_references
βœ“ test_parse_multiple_tables
βœ“ test_to_json
βœ“ test_dumps / test_dumps_isonl
... and 24 more tests

Python Validation (isonantic) - 39 tests

βœ“ test_string_field_required
βœ“ test_string_min_length
βœ“ test_email_validation
βœ“ test_int_field / test_float_field
βœ“ test_reference_field
βœ“ test_table_schema
... and 33 more tests

Rust (ison-rs) - 9 tests

βœ“ test_dumps_with_delimiter
βœ“ test_isonl
βœ“ test_ison_to_json
βœ“ test_json_to_ison
βœ“ test_parse_references
βœ“ test_parse_simple_table
βœ“ test_roundtrip
βœ“ test_type_inference
βœ“ test_version
βœ“ doc-tests

C++ (ison-cpp) - 30 tests

βœ“ parse_simple_table
βœ“ parse_object_block
βœ“ parse_multiple_blocks
βœ“ type_inference (int, float, bool, null, string)
βœ“ parse_references (simple, namespaced, relationship)
βœ“ serialize_roundtrip
βœ“ parse_isonl / serialize_isonl
βœ“ to_json
... and 15 more tests

Go (ison-go) - 28 tests

βœ“ TestParseSimpleTable
βœ“ TestParseTypedFields
βœ“ TestParseQuotedStrings
βœ“ TestParseNullValues
βœ“ TestParseReferences
βœ“ TestParseObjectBlock
βœ“ TestParseMultipleBlocks
βœ“ TestDumps / TestRoundtrip
βœ“ TestDumpsISONL / TestParseISONL
βœ“ TestToJSON / TestFromJSON
... and 18 more tests

Go Validation (isonantic-go) - 55 tests

βœ“ TestStringRequired / TestStringOptional
βœ“ TestStringMinLength / TestStringMaxLength
βœ“ TestStringEmail / TestStringURL
βœ“ TestNumberMin / TestNumberPositive
βœ“ TestIntSchema / TestBooleanRequired
βœ“ TestRefRequired / TestRefNamespace
βœ“ TestObjectFieldValidation
βœ“ TestTableRowValidation
βœ“ TestDocumentParse / TestDocumentSafeParse
... and 46 more tests

Benchmark Results πŸ†

300-Question Benchmark across 20 datasets using GPT-4o tokenizer (o200k_base):

Format Total Tokens vs JSON Accuracy Acc/1K Tokens
ISON 3,550 -72.0% 88.3% 24.88
TOON 4,847 -61.7% 88.7% 18.29
JSON Compact 7,339 -42.1% 89.0% 12.13
JSON 12,668 baseline 84.7% 6.68

Key Results

  • βœ… ISON won ALL 20 token benchmarks
  • βœ… 272% more efficient than JSON (Accuracy per 1K tokens)
  • βœ… 27% more token-efficient than TOON
  • βœ… 3.6x more data in same context window

πŸ‘‰ Full Benchmark Details | Run the Benchmark


Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE for details.


Author

Mahesh Vaikri


ISON - Less tokens, more context, better AI.

About

πŸ”₯ πŸ”₯ Alternative to JSON πŸ”₯ πŸ”₯

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •