Installation
TTOON 0.1.x packages are published to PyPI, npm, and crates.io. The official documentation site is ttoon.dev.
- Python
- JavaScript / TypeScript
- Rust
pip install ttoon
If you need to install from a source distribution manually:
pip install ./ttoon-0.1.0.tar.gz
pyarrow and polars are already declared as package dependencies. No extra step is needed for the normal wheel install.
The current Python package depends on pyarrow>=23.0.0 and polars>=1.37.1.
If you are working from a stripped-down environment, install them explicitly:
pip install pyarrow polars
Requires Python 3.11+. Installing from wheel does not require a Rust toolchain; installing from sdist does.
npm install @ttoon/shared
For Arrow table operations, add the optional peer dependency:
npm install @ttoon/shared apache-arrow
For custom decimal codecs, install the library your codec uses. Common choices are decimal.js and big.js:
npm install @ttoon/shared decimal.js
npm install @ttoon/shared big.js
Note:
@ttoon/nodeand@ttoon/webare environment-specific re-exports of@ttoon/shared. Install@ttoon/shareddirectly unless you want explicit environment-specific imports.
npm install @ttoon/node
npm install @ttoon/web
The JS SDK uses a WASM bridge to invoke the Rust core engine. The WASM module is bundled inside the package — no additional setup required.
cargo add ttoon-core
The ttoon-core crate includes Apache Arrow support by default.
Official SDKs
All SDKs share the same Rust core, ensuring consistent parsing and serialization behavior. The JS packages are split by runtime target, but @ttoon/node and @ttoon/web are thin re-exports of @ttoon/shared.
| Language | Package | Architecture |
|---|---|---|
| Python | ttoon | Rust core via PyO3 |
| JS / TS | @ttoon/shared | Rust core via WASM |
| Node.js | @ttoon/node | Re-exports shared |
| Web | @ttoon/web | Re-exports shared |
| Rust | ttoon-core | Core engine |
Verify Installation
- Python
- JavaScript
- Rust
import ttoon
print(ttoon.dumps({"hello": "world"}))
# hello: "world"
import { initWasm, stringify } from '@ttoon/shared';
await initWasm();
console.log(stringify({ hello: 'world' }));
// hello: "world"
use ttoon_core::{from_ttoon, to_ttoon};
let node = from_ttoon("hello: \"world\"").unwrap();
let text = to_ttoon(&node, None).unwrap();
assert_eq!(text, "hello: \"world\"\n");