| Crates.io | tja |
| lib.rs | tja |
| version | 0.5.0 |
| created_at | 2024-04-20 19:00:55.775439+00 |
| updated_at | 2025-12-28 09:33:53.133971+00 |
| description | TJA file parser written in Rust, working in Rust, Python, and WebAssembly. |
| homepage | https://github.com/JacobLinCool/tja-rs |
| repository | https://github.com/JacobLinCool/tja-rs |
| max_upload_size | |
| id | 1214794 |
| size | 3,168,570 |
An efficient TJA file parser, written in Rust, that supports Rust, Python, and WebAssembly environments.
It is highly optimized for speed and includes features such as a synthesizer for synthesizing music along with don/ka sound effects from a TJA file.
It's fast! (Parse thousands of TJAs in less than 1 second) Check out the benchmark.
You can also use different parsing modes (e.g. metadata-only or metadata-and-header mode) to make it even faster.
The Rust target requires no additional feature flags.
To build the library, run:
cargo build
To build the CLI tool, run:
cargo build --bin tja
We use maturin to build the Python package. The Python package requires the python feature flag to be enabled.
To build the Python package .whl, run:
maturin build -F python --release
To develop and test, run:
maturin develop -F python
Python virtual environment is necessary. (e.g.
conda,micromamba,poetry,pixi)
To navigate variable, please check tja.pyi
We use wasm-pack to build the WebAssembly package. The WebAssembly package requires the wasm feature flag to be enabled.
To build the WebAssembly package, run:
wasm-pack build --features wasm
The parser is highly optimized for performance.
It can parse a typical TJA file in under 1 ms in full mode, and in metadata-only mode in under 5 µs.
For detailed benchmarks and comparisons, check out our benchmark report.
To run the benchmark:
cargo bench
The TJA parser includes a synthesizer binary that can synthesize music along with don/ka sound effects from a TJA file:
cargo run -F audio --bin synthesize <TJA file> <music file> <don sound file> <ka sound file> --course <course> --branch <branch>