Fast TOON (Token-Oriented Object Notation) encoder. Byte-identical to the TOON spec, 8x faster than toons and 2.7x faster than the official TS SDK.
Project description
etoon
Fast TOON (Token-Oriented Object Notation) encoder for Python, Rust, and CLI.
8× faster than toons, 2.7× faster than the official TS SDK, byte-identical output.
Performance
Measured on a 50-doc "neptune" payload (7480 bytes JSON → 4012 bytes TOON):
| Encoder | Time | Relative |
|---|---|---|
| etoon (Python) | 13.0 μs | 1.00× |
| @toon-format/toon (TS) | 35.6 μs | 2.73× |
| py-rtoon | 85.9 μs | 6.59× |
| toons | 106.4 μs | 8.17× |
CLI via stdin pipe (Claude / Bash workflows):
| CLI | Per call | Relative |
|---|---|---|
| etoon | 0.57 ms | 1.00× |
| official toon | 50.7 ms | 89× slower |
Install
Python
pip install etoon
Rust library
cargo add etoon --no-default-features
CLI binary
Download from GitHub Releases, or:
cargo install etoon
Usage
Python
import etoon
docs = [{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]
print(etoon.dumps(docs))
# [2]{id,name}:
# 1,Alice
# 2,Bob
CLI (Bash pipe)
curl -s https://api.example.com/data | etoon
cat data.json | etoon -o output.toon
Rust
let json_bytes = serde_json::to_vec(&my_data)?;
let toon = etoon::toon::encode(&json_bytes)?;
Architecture
Python dict → orjson.dumps → JSON bytes → sonic-rs (SIMD parse) → walk → TOON string
Key optimizations:
- sonic-rs SIMD JSON parser (~7× faster than serde_json)
- orjson bridge — single boundary crossing (vs PyO3-based alternatives)
- uniform-order table fast path — skips 300 key lookups per 50-row table
- itoa specialized integer formatting
Compatibility
Output is byte-identical to the toons Python package (Apache 2.0) and the
official toon-format/toon TypeScript SDK. Passes 111/111 TOON spec
fixtures covering primitives, objects, arrays (primitive/tabular/nested/bulleted),
and whitespace.
Limitations
- Integers > 2⁶³ are lossily coerced via f64 (works for most common big integers that happen to be representable; arbitrary-precision is not supported).
- Custom
indentis hardcoded to 2 spaces (TOON spec default). - TOON-specific features not yet supported:
--fold-keys,--delimiter tab/pipe.
License
Apache 2.0. Test fixtures in tests/fixtures/ are sourced from the
toons project (Apache 2.0).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file etoon-0.1.1.tar.gz.
File metadata
- Download URL: etoon-0.1.1.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75851ab33e202be086d12ca0ae5ce5f33d21b2a40a2721f09341ff5c0d5043a
|
|
| MD5 |
9df4355b199b2db24191913a72b71928
|
|
| BLAKE2b-256 |
6a14933d8895292484784e472c8d0915fb55b4a9a8657d523b8409aca7a1f323
|
File details
Details for the file etoon-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: etoon-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 226.4 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1bc8b8a981d44f030571e3a791b741f1d5a1ea4335a7c9268688ce4fad42a3c
|
|
| MD5 |
598a786e6db14a5e1f954eabee8e7851
|
|
| BLAKE2b-256 |
7d91ad086bfcee8340e16a1a8af6d3cd6b60fc3a7a3ff67abe70f576f8f8c62f
|
File details
Details for the file etoon-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 321.3 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1098ae02443c6248220d5cd97eb9a5c93a4eeed77d09ccd9bb2e6b04df92755
|
|
| MD5 |
5442c1525bf6e69af6f8653f5998602c
|
|
| BLAKE2b-256 |
d91be3508a0170bec149b5b8bd1c602b036e3dff587f11bc8c2ccb339657a9d5
|
File details
Details for the file etoon-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: etoon-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 298.0 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e01701033b79fe8f01ea1f652d05c55de85b178a608c77929344b440a4cd5b2f
|
|
| MD5 |
e98b0dcddeec701978bb05adf1d54bcd
|
|
| BLAKE2b-256 |
d6859cdb4e8564ea29f7ee8b5768a6c6a7e563440f6deabe4036d0ac5a2c7c70
|
File details
Details for the file etoon-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: etoon-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 281.7 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d2f760b83c6118a92f55357ade15ec031e04299ad18a603cdcdb04fa389f2d
|
|
| MD5 |
d3a0423ab65ba7376f6fe7bd5ea7be33
|
|
| BLAKE2b-256 |
03f1f14f7b81f81c49eacbb7e34f09aa580077eb1de5d91be98c43914954d5ed
|
File details
Details for the file etoon-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl
- Upload date:
- Size: 305.2 kB
- Tags: CPython 3.13, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8d638ade9011fb9c74f5a394611cdecfdc489ee7c3dceb34fdee6d2edf2898b
|
|
| MD5 |
a3aae55ad147e388047e8dc29bcf50bd
|
|
| BLAKE2b-256 |
eecb32879f8543815d6fe8454aa467d6ca1e5e7d9e4129d7618dfe4bbc55cc9b
|
File details
Details for the file etoon-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: etoon-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 226.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1df809144b29f67b4d4c2ca4633959d761a80bc131cd5fd359bcf493e5255305
|
|
| MD5 |
0517041378ec56da19b95b06ff39a8ec
|
|
| BLAKE2b-256 |
901efcdd7856c2dc38d96ff6d52fcdd501136c5902f0d698ebff840c67699837
|
File details
Details for the file etoon-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 321.0 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5b5530a235e8a8a19f3036bfaf5cb14105a1cde09084d13fe060dc7c33b215
|
|
| MD5 |
b3090ca5ccb06b398bc0c6e28a0d2178
|
|
| BLAKE2b-256 |
a679ce1fa5123ec2c45329990974d05c1d5b67efc2781965ba868b7323ea19de
|
File details
Details for the file etoon-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: etoon-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 297.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9e84a0ebcb0447d011a5d346cfad26e62808b324c99e988d24be9e142445dcd
|
|
| MD5 |
cccf286b1950fd5bac992d1ae29eae46
|
|
| BLAKE2b-256 |
129a44b56d527cffcbdcaba1e8f99586d532b62eac34084ad9e7c7cec012d9c6
|
File details
Details for the file etoon-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: etoon-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 281.4 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3122833e44d6b4de79b4b77b49e806e81978b3fc3c733820aa44dd2f18ac422c
|
|
| MD5 |
e5571ccb007af570967196cb3f067fbf
|
|
| BLAKE2b-256 |
b91c7b316c9ebe43f11e03745d44ad7fb840125bafc01c0376ec2ac88b302f7d
|
File details
Details for the file etoon-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 304.9 kB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6597616b369bf81a293fd40e105182e5acbf56bf7b068dbe77fefc49f5ea952
|
|
| MD5 |
18070d0392a5b14701b3284da0094e3c
|
|
| BLAKE2b-256 |
781ae801d929a77d8a9deca7a9f79c8640b0b28c7b16d09105107770c5f3a646
|
File details
Details for the file etoon-0.1.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: etoon-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 227.6 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d62ca256e578037e05248610579b4aefbbe04316895ce68bf10621b03269247
|
|
| MD5 |
07d467d5ec5c8fee7bf466444ed5b2e6
|
|
| BLAKE2b-256 |
a0c54cf4095458e40c6be4475b5159c451dd605e52e1e2b8197543400d9a150f
|
File details
Details for the file etoon-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 321.6 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6047594552b22493afc176ecda4bed3357fee0cfb21dbe373e415ad01e9f5d24
|
|
| MD5 |
64b5cd96aa789e526270439b461b3f51
|
|
| BLAKE2b-256 |
2be1ab6c4d66982c3ef8312ff0505b0b8212a7f5cb283505e2f8f0063e9d87c8
|
File details
Details for the file etoon-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: etoon-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 298.2 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eaea0670199a84fb432187026ee9ac04b87b52e851e5805321498f451db9440
|
|
| MD5 |
29bf34134b6d0bd381fad13203d37b0d
|
|
| BLAKE2b-256 |
f4858c1ff2d8e069694205b6c5d92e6c8c0cf03cb272a902b8410f61961fe8fc
|
File details
Details for the file etoon-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: etoon-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 282.1 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0101092a34647a95cb338fb0e428266726b9b843c9de0034e7aeca505c2925af
|
|
| MD5 |
effc12fd89bd89440ed886326a7f0d43
|
|
| BLAKE2b-256 |
cf7d480580c10dc780a31cab449aaf0eea23eb452caea1e4fa7f29de5628717c
|
File details
Details for the file etoon-0.1.1-cp311-cp311-macosx_10_12_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp311-cp311-macosx_10_12_x86_64.whl
- Upload date:
- Size: 305.6 kB
- Tags: CPython 3.11, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6bafca349fc4556cd4f83250d3f59cf31465252b680c04343f047bd5508a733
|
|
| MD5 |
95d30b6e85606a0a54b854068fd5c96b
|
|
| BLAKE2b-256 |
1649908311a07ec0bfc2e4a95a461ee79634d84fee411bf45c965988217d68bc
|
File details
Details for the file etoon-0.1.1-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: etoon-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 227.6 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d778907e2bd33c5c92451a8136aa02c5411ad7947f251c4159a56593d74c07f
|
|
| MD5 |
ae7f1ddf7f6c3b02b82e47cabec86004
|
|
| BLAKE2b-256 |
f28e133f5fddc51247416b7411c76df301942626dab470e0e88efe7510879443
|
File details
Details for the file etoon-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 321.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c492a4b1de37056210bba66586789aa2e7721c1fcee020e6cdd55a28ff2b7f77
|
|
| MD5 |
9ab8d25e6a51a87fe523dcb4407a6d3e
|
|
| BLAKE2b-256 |
97af026c5e76535c86f6b6bcef4b9838f99e590aea06954fd72c7c5a878d4e57
|
File details
Details for the file etoon-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: etoon-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 298.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4837080b0d7cab3858dd0047f025e28b98261c83d8812114748fc0e50f063f02
|
|
| MD5 |
cf8a8fc13eb24759330bed5507d48d94
|
|
| BLAKE2b-256 |
4730c4e70b02ec3f89559d61a8073bdba331be2070165a02b01da454655e0841
|
File details
Details for the file etoon-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: etoon-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 282.2 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d2ce2951bab56362b39ee91a23865230a5d61c1b11aa7ebfe2c610cb0215f3b
|
|
| MD5 |
8af01c25b8e810abae9bb54a25cf24cb
|
|
| BLAKE2b-256 |
cbe6d4e4893b273a224c57607ac32700638d3f8fadf321ce8e5e4e0a3a4a566e
|
File details
Details for the file etoon-0.1.1-cp310-cp310-macosx_10_12_x86_64.whl.
File metadata
- Download URL: etoon-0.1.1-cp310-cp310-macosx_10_12_x86_64.whl
- Upload date:
- Size: 305.7 kB
- Tags: CPython 3.10, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76a53f7cceaec131135639c5a11d50daef1f1ca480fe37c710861aec5a7e8b16
|
|
| MD5 |
986410364e5598b594c7ebd77f3ee17a
|
|
| BLAKE2b-256 |
18f5ca93d049f16c04e235b1db1a6ec03055fcb5077ddbb3ac1cebf9685e37ce
|