跳至主要內容

安裝

目前 0.1.x 版的 TTOON 套件已發布到 PyPI、npm 與 crates.io。官方文件網站為 ttoon.dev

pip install ttoon

若需要手動安裝原始碼發行包:

pip install ./ttoon-0.1.0.tar.gz

pyarrowpolars 已被宣告為套件依賴項。普通的 wheel 安裝不需要額外步驟。

目前的 Python 套件依賴於 pyarrow>=23.0.0polars>=1.37.1

如果您在一個精簡的環境中工作,請明確地安裝它們:

pip install pyarrow polars

需要 Python 3.11+。若安裝 wheel,Rust 核心已內建於 wheel 中;若安裝 sdist,則需要本地 Rust 工具鏈。

官方 SDK

所有 SDK 都共享同一套 Rust 核心,確保解析與序列化行為一致。JS 套件依執行環境拆分,但 @ttoon/node@ttoon/web 本質上都只是 @ttoon/shared 的薄重新匯出層。

語言套件架構
Pythonttoon透過 PyO3 的 Rust 核心
JS / TS@ttoon/shared透過 WASM 的 Rust 核心
Node.js@ttoon/node重新匯出 shared
Web@ttoon/web重新匯出 shared
Rustttoon-core核心引擎

驗證安裝

import ttoon
print(ttoon.dumps({"hello": "world"}))
# hello: "world"