toon_format 0.1.0 copy "toon_format: ^0.1.0" to clipboard
toon_format: ^0.1.0 copied to clipboard

Token-Oriented Object Notation (TOON) - a token-efficient JSON alternative for LLM prompts

TOON Format for Dart #

pub package Documentation License: MIT

Token-Oriented Object Notation is a compact, human-readable format designed for passing structured data to Large Language Models with significantly reduced token usage.

Status #

🚧 This package is currently a namespace reservation. Full implementation coming soon!

Example #

JSON (verbose):

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin" },
    { "id": 2, "name": "Bob", "role": "user" }
  ]
}

TOON (compact):

users[2]{id,name,role}:
  1,Alice,admin
  2,Bob,user

Resources #

Future Usage #

Once implemented, the package will provide:

import 'package:toon_format/toon_format.dart';

void main() {
  final data = {
    'users': [
      {'id': 1, 'name': 'Alice', 'role': 'admin'},
      {'id': 2, 'name': 'Bob', 'role': 'user'}
    ]
  };

  final toonString = encode(data);
  final decoded = decode(toonString);
}

Contributing #

Interested in implementing TOON for Dart? Check out the specification and feel free to contribute!

License #

MIT License © 2025-PRESENT Johann Schopplich

3
likes
160
points
45
downloads

Publisher

unverified uploader

Weekly Downloads

Token-Oriented Object Notation (TOON) - a token-efficient JSON alternative for LLM prompts

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

Documentation
API reference

License

MIT (license)

More

Packages that depend on toon_format