Skip to main content

API Matrix

All three TTOON SDKs provide a fully aligned API surface: 18/18 across Rust, JavaScript, and Python.

Grouped Reference Pages

The detailed API reference is organized by workload instead of by language:

  • T-TOON Batch API — batch read / write / transcode APIs centered on T-TOON text
  • T-JSON Batch API — batch read / write / transcode APIs centered on T-JSON text
  • Stream API — streaming readers and writers for both formats

Batch Deserialization

CapabilityRustJavaScriptPython
Text → Object/IRfrom_ttoon(text)parse(text)loads(text)
Text → Arrowread_arrow(text)readArrow(text)read_arrow(text)

All batch deserialization APIs auto-detect the input format (T-TOON / T-JSON / typed unit).

Batch Serialization

CapabilityRustJavaScriptPython
Object → T-TOONto_ttoon(node)stringify(value)dumps(obj)
Object → T-JSONto_tjson(node)toTjson(value)to_tjson(obj)
Arrow → T-TOONarrow_to_ttoon(table)stringifyArrow(table)dumps(df/table)
Arrow → T-JSONarrow_to_tjson(table)stringifyArrowTjson(table)stringify_arrow_tjson(table)

Python dumps() auto-detects Polars DataFrame and PyArrow Table/RecordBatch inputs, routing them to the Arrow path internally.

Streaming Deserialization

CapabilityRustJavaScriptPython
T-TOON → ObjectStreamReaderstreamRead(source, opts)stream_read(source, schema)
T-JSON → ObjectTjsonStreamReaderstreamReadTjson(source, opts)stream_read_tjson(source, schema)
T-TOON → ArrowArrowStreamReaderstreamReadArrow(source, opts)stream_read_arrow(source, schema)
T-JSON → ArrowTjsonArrowStreamReaderstreamReadArrowTjson(source, opts)stream_read_arrow_tjson(source, schema)

All streaming readers require a StreamSchema to define field names and types.

Streaming Serialization

CapabilityRustJavaScriptPython
Object → T-TOONStreamWriterstreamWriter(sink, opts)stream_writer(sink, schema)
Object → T-JSONTjsonStreamWriterstreamWriterTjson(sink, opts)stream_writer_tjson(sink, schema)
Arrow → T-TOONArrowStreamWriterstreamWriterArrow(sink, opts)stream_writer_arrow(sink, schema)
Arrow → T-JSONTjsonArrowStreamWriterstreamWriterArrowTjson(sink, opts)stream_writer_arrow_tjson(sink, schema)

All streaming writers require a StreamSchema.

Direct Transcode

CapabilityRustJavaScriptPython
T-JSON → T-TOONtjson_to_ttoon(text)tjsonToTtoon(text)tjson_to_ttoon(text)
T-TOON → T-JSONttoon_to_tjson(text, mode)ttoonToTjson(text)ttoon_to_tjson(text)

Transcode passes through Rust IR only — no language-native objects are materialized. All typed semantics (decimal, uuid, etc.) are fully preserved.

Utilities

CapabilityRustJavaScriptPython
Format detectiondetect_format(text)detectFormat(text)detect_format(text)
Codec registration— (native types)use(codecs)use(codecs)
Schema definitionStreamSchemaStreamSchemaStreamSchema

Coverage Statistics

DimensionRustJavaScriptPython
Batch (deser + ser)6/66/66/6
Streaming (deser + ser)8/88/88/8
Transcode2/22/22/2
Utilities2/22/22/2
Total18/1818/1818/18

Codec registration is excluded from the 18/18 parity count because it is JS/Python-only; the matrix counts only APIs that exist across all three SDKs.

Architecture Notes

Rust as Canonical Engine

Rust ttoon-core is the canonical implementation. Both the Python and JavaScript SDKs delegate to the Rust core:

  • Python — via PyO3 native extension (compiled into the wheel)
  • JavaScript — via WASM bridge (bundled in the npm package)

This ensures identical parsing and serialization behavior across all platforms.

Streaming Format Conventions

  • T-TOON streaming uses [*]{fields}: as the unbounded tabular header (in contrast to [N]{fields}: which declares a fixed row count).
  • T-JSON streaming uses a top-level array of objects with schema-known scalar values.

Arrow Path Optimization

The Rust core includes a direct Arrow path for T-JSON input (tjson_arrow::read_arrow_tjson_direct) that skips the Token/Node intermediate layer, significantly reducing memory usage for large datasets. This optimization benefits all SDKs through the shared core.