Skip to main content

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 indent is 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

etoon-0.1.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

etoon-0.1.0-cp313-cp313-win_amd64.whl (227.8 kB view details)

Uploaded CPython 3.13Windows x86-64

etoon-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (322.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

etoon-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (299.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

etoon-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (282.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

etoon-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl (306.6 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

etoon-0.1.0-cp312-cp312-win_amd64.whl (227.6 kB view details)

Uploaded CPython 3.12Windows x86-64

etoon-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (322.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

etoon-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (298.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

etoon-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (282.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

etoon-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl (306.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

etoon-0.1.0-cp311-cp311-win_amd64.whl (229.2 kB view details)

Uploaded CPython 3.11Windows x86-64

etoon-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (322.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

etoon-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (299.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

etoon-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (283.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

etoon-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl (307.0 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

etoon-0.1.0-cp310-cp310-win_amd64.whl (229.3 kB view details)

Uploaded CPython 3.10Windows x86-64

etoon-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

etoon-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (299.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

etoon-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (283.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

etoon-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl (307.2 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file etoon-0.1.0.tar.gz.

File metadata

  • Download URL: etoon-0.1.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etoon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b011c5b459856190c9748801596822e75639b688ff0d02b2bb072b2658e1a88a
MD5 4d7423782973a53a93d2feda3914b8e8
BLAKE2b-256 1e19cea60c2c24eaea4fc9077780963ef1f435d3c2a7f294c93300a004ff9163

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: etoon-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 227.8 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

Hashes for etoon-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 347a066a7acce59efedf07121668f07c499cd3716ee2c721878882cb83602189
MD5 0079fe99cecc1b3bd58482ca94468e61
BLAKE2b-256 4a99cbc4073fb23c3dd005efb11f1dcd0ab6a5ce59664cdb8647f6bee18d0ce1

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0c84b507a431f810ca53de8df881b6b553736453098f4599921a4c64abab868
MD5 376ac2d1fd6a00b21545279fded7b172
BLAKE2b-256 e9c10737f7aaeab8674365779ac30fbe6fd75a93299242d27650260d68fe222a

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2f023f4bf372d3c541911859b5cf042c223e7c3d0bf508d56795faa335ebdac
MD5 223edaea337f114bb84749a8b3c56ad9
BLAKE2b-256 9da014da24422bd484a252ab775c7e050ac86357f0d5e08a9060024288b73540

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65bdc733b4224b5014ada3c97844a3202e9c34804a7075f7ddaaa61670a38ad6
MD5 90bb12ab92aaa2c07ea89a2b5dea0797
BLAKE2b-256 a49942141bc44bc7d0ef004461e9bf9ee0143bb102f4750cd94d2ee8907fa29f

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 54f0071661d7d73b82b953b700bb748b0319572cd9f23850130b382e5b7c889a
MD5 887578e2b782afe0e86a4659a52a2c99
BLAKE2b-256 17a55be3b92de89ed01dde2c436f032edf5de6745cd3a842043703be8d983dbb

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: etoon-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 227.6 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

Hashes for etoon-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 90c183491b090ceba12659e5a80138b00e3430d090555c7ee08021393c6f2a86
MD5 59d951b18eea40b7633e2128d6c520a5
BLAKE2b-256 7925051758cb5a8825c8f4a549078c6964b71389304f78ea8a0c40220c58c731

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1e248e8c18d2e7095fb19d7aeaa180c3317365a3f9da5257198f8c5782823d7
MD5 a2cc9d7a418c45a8278d9af103e06b18
BLAKE2b-256 9d3fe55e857a1332244dde8badfd657607e30778ab08c6d10833e8adf7916e64

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 29aae2d699acf73306772062bec9cfa741d7be533e1234e079cd3bd33d4f26eb
MD5 8573cfe3b0f227d038ff1f6b67bacf5d
BLAKE2b-256 44178defa49929fa43cabfdb0c775e204442fd658b1c87e0ddb3758f614e0ca4

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db6f6257065ec3e732c63173964fd759cbcfd73cf9ea9e363ce9abea986793a3
MD5 ef06bb0dcaa621808d9ac3c32f7018fe
BLAKE2b-256 8f06300cefcb6215e1ee04f0da62d6ae77a9260004853170a2ae55e39dee6318

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8c4c26651128ed8221ec52c9fcc04e25a23580e8e18ba68c5c0aa928c78aaddb
MD5 42cd2546a8960d88721f3750d9b2e2d1
BLAKE2b-256 0382608ab9f3473e83b530c5004b5533cb66e023f11a369bf52e280a603bb9c3

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: etoon-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 229.2 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

Hashes for etoon-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1b860ef5b3514b8ff0d09f0fd984ec1d6a4d0ad3bc9e7420d10d67aab15caded
MD5 1a3ef9d4702be8d5a1cd1fe2005c7859
BLAKE2b-256 a6854080a8c1c330c5339490b9557a9c57923bcceeccf4b0fcdc23164bb40c0e

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9df65c4b38ecd8f415db33e578c4df1c56573ef545c25646d85ccec609e0cd04
MD5 565dec2795b3525748b6973cdf4fe88e
BLAKE2b-256 8efcd0d26acd2877a6625f3b79f9d19ecff104fa39ad891bc616cd10e4755607

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0c6492876ba62b6289819885e3254f6be1f15dec771c5fc091e5dbe92f508ab2
MD5 7911277116f9fedc312f3b1291f9295c
BLAKE2b-256 d0fec018b6f6bc96a02e200314c88e68e58fe87fa20afdaaa62efe127a0734e2

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0eec8018c3293043a56a795c28f112079e7c6c513ba7d6298e02cfd64eba7246
MD5 fa46663d046ac996054a7c0a9137a4b4
BLAKE2b-256 5bd37782a6736452e6a77c725fe760ad8eb56cf65157b3fb816fef250b386ae9

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 96c703d977061375141c611c2da7a151243076af84611ec19d15311e648e48a1
MD5 fd6d4cfd09640b22a24dc37993d21fb5
BLAKE2b-256 60e1e5e610fdeef69acb491f4acabe369578eb217907dc9c2b4545160584a288

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: etoon-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 229.3 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

Hashes for etoon-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4e12c811d591fd243b3aa969256248a3ec1f94618f65ca721510203d4d240532
MD5 a2703c469c8aeb32b04905a93fc7c258
BLAKE2b-256 f01af243253d95f25a23e5e4b5bffe49f3f8655c8102ac02e0f6c76550e2d80b

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47e785cd7c11d019d3f244334549272e3ee025d395ab4b78fbeed0f8072ac48b
MD5 da2b0dc02c1e784070efc0cf145eed33
BLAKE2b-256 78c9eff2dfd3e94ebf80fb742fd7ac7a532613b77c0695d7caa8d4035a9c340e

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4ccefcd4dd8e41ac8ca9176fd380819a563e6306569c231cdf720ff2f4420a62
MD5 49475ffe3e65a73492436025b1dca559
BLAKE2b-256 5dbb5bb94dde26f643078c41be1950654c5d916f75ed67f55eb207c06dd01dd7

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d10e6bf2a00b0c888ff136718713ddaa6f67bcf4b42820da9e673341c12882c0
MD5 1cebba45d01a8996de9bbfe0e701bc6d
BLAKE2b-256 d8b865de47bddda6903f5ae042cb785a82eed315f31df90af0878bde58a12181

See more details on using hashes here.

File details

Details for the file etoon-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for etoon-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1d57f131e7e0117845a2e4efa907625584d9f45383e30a981f95b6e8d7558d3b
MD5 f70a3ff6039f5e501c2f3c460e1d7d82
BLAKE2b-256 801448ff33ab2d02d3896699d08301d7f1e5890f3832de53800acff6a1cdbd30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page