Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

No Python API

Status: Current Last updated: 2026-07-14 10:18 EDT

Batchalign3 does not have a public Python API. Python lives inside the package as a worker-side ML inference layer, strictly an internal implementation detail of the Rust runtime. As of 2026-05, only Rev.AI ASR is Rust-owned (driven directly from the server); every other ASR engine, plus all morphosyntactic / segmentation / translation / coref pipelines, runs through a Python worker. The long-term direction is to keep narrowing the Python layer as Rust gains coverage of more ML pieces. A Rust-native Whisper path (whisper_rs, whisper.cpp via whisper-rs) now exists behind the opt-in whisper-rs-backend Cargo feature, though the default build still routes Whisper through the Python worker.

The CLI is the entry point

All processing is done through the batchalign3 command-line tool:

batchalign3 transcribe input/ -o output/ --lang eng
# morphotag has no --lang, per-file @Languages: header drives routing
batchalign3 morphotag input/ -o output/
batchalign3 align input/ -o output/ --lang eng

For programmatic use from Python, call the CLI as a subprocess:

import subprocess

subprocess.run(
    [
        "batchalign3", "morphotag",
        "input/", "-o", "output/",
        "--lang", "eng",
    ],
    check=True,
)

Anything else, importing batchalign.* modules, calling batchalign_core.* symbols, depending on batchalign.providers, batchalign.worker.*, or any Python class or function, is unsupported and will break without notice. There is no compatibility surface to build against.

If you used the BA2 Python API

The following BA2 Python entry points were removed during the BA3 rewrite. The CLI is the replacement for all of them:

BA2 Python entry pointReplacement
BatchalignPipelinebatchalign3 <command>
WhisperEngine, RevAIEngine, etc.batchalign3 transcribe --asr-engine <name>
CHATFile, Document, ParsedChatthe chatter CLI in talkbank-tools (chatter to-json, chatter validate, etc.)
run_pipeline(), LocalProviderInvoker, PipelineOperationbatchalign3 <command>
compute_wer()batchalign3 compare
batchalign.compatnone, its purpose was to bridge BA2 callers; rewrite around the CLI

If you have BA2 Python integration code, port it to subprocess calls into batchalign3. The CLI’s output format is the long-term stable contract.

See also


This page last changed: 2026-07-29 (commit f4f12680). The whole book last changed: 2026-09-16 (commit 34d249d8).