toon_format 0.1.0
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 #
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