Download the PHP package iamgerwin/toon-php without Composer

On this page you can find all versions of the php package iamgerwin/toon-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package toon-php

TOON PHP

Latest Version on Packagist Tests Total Downloads

Stop wasting tokens. Start saving money.

A lightweight, blazing-fast TOON (Token-Oriented Object Notation) library for PHP that cuts your LLM API costs by 30-60%. Because every token counts when you're building AI applications.

Why TOON?

Traditional JSON is expensive for AI applications. Every {, }, [, ], and " counts as a token. TOON eliminates this waste while maintaining perfect readability.

Real-World Performance

Based on official TOON benchmarks:

Use Case JSON Tokens TOON Tokens Savings
E-commerce Orders 3,245 2,170 33.1%
User Lists 150 82 45.3%
Product Catalogs 320 180 43.8%
Event Logs 1,890 1,606 15.0%
Config Files 2,456 1,687 31.3%

Cost Impact

At OpenAI's GPT-4 pricing ($0.03/1K tokens):

Installation

Requirements:

Quick Start

Powerful Features

🎯 Tabular Format for Arrays

Perfect for uniform datasets:

73.9% retrieval accuracy vs 70.7% for JSON in LLM benchmarks (source).

⚡ Multiple Encoding Modes

🔍 Token Analysis

🎨 Complete Type Support

Helper Functions

When to Use TOON

✅ Perfect For:

⚠️ Consider JSON When:

Benchmarks

Independent tests show TOON's advantages:

Token Efficiency

LLM Retrieval Accuracy

Tested across 209 questions on 4 LLM models:

TOON achieves +3.2% better accuracy while using 39.6% fewer tokens (source).

Processing Speed

Advanced Usage

Strict vs Lenient Decoding

Custom Delimiters

Quality Assurance

This package maintains the highest quality standards:

Real-World Example

Migration from JSON

Zero-effort migration:

Contributing

Contributions are welcome! This package follows:

Versioning

This library follows Semantic Versioning with separate branches for different PHP versions:

Version 2.x is the recommended and default version for new projects. Composer will automatically select v2.x for PHP 8.1+ installations and v1.x for PHP 7.0-8.0 installations.

Branches

Installation by PHP Version

Feature Differences

Feature v2.x (PHP 8.1+) v1.x (PHP 7.0-8.0)
TOON Encoding/Decoding
DateTime Support
Enum Support ❌ (PHP 8.1+ only)
Tabular Format
Helper Functions
PHPStan Analysis Level 6 Level 6
Test Coverage 29 tests 32 tests

License

MIT License - see LICENSE.md

Credits


Stop paying for redundant tokens. Start using TOON PHP.

See Examples


All versions of toon-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iamgerwin/toon-php contains the following files

Loading the files please wait ...