Skip to main content

Translate SRT/VTT/TSV via a local LLM (Ollama-compatible). CLI-first; stdlib-only core.

Project description

Subsetzer

Subsetzer is a stdlib-only subtitle translation toolkit that talks to an Ollama-compatible LLM running on your LAN. Feed it .srt, .vtt, or .tsv files, choose the target language, and it handles parsing, chunking, and translation. The CLI stays faithful to the former setzer tool, but now ships under a new name ready for PyPI.

Features

  • Translate SRT, VTT, and TSV subtitle files via Ollama-compatible APIs.
  • Keep bracketed tags (like [MUSIC]) intact with --no-translate-bracketed.
  • Chunk large transcripts with configurable --max-chars and --cues-per-request.
  • Output SRT, VTT (with NOTE block including model + timestamp), or TSV files.
  • Run with pipx, inside a virtual environment, or directly from source.

Installation

pipx install subsetzer
# or
pip install subsetzer

Ensure you have an accessible Ollama server (default http://127.0.0.1:11434) with a compatible model pulled (default gemma3:12b).

CLI Usage

subsetzer --in input.srt --out ./out --target "German"

Useful flags (all mirrored from the previous CLI):

  • --outfmt {auto,srt,vtt,tsv} to override the output format.
  • --outfile TEMPLATE to customise the output path (placeholders: {basename}, {dst}, {fmt}, {src}, {ts}, {model}). The default template now adds the model slug so parallel runs stay separate.
  • --cues-per-request / --batch-per-chunk to batch cues per LLM call.
  • --llm-mode {auto,chat,generate} to force the Ollama API flavour.
  • --stream/--no-stream, --timeout, --no-llm, --debug behave as before.

Run subsetzer --help for the full flag list.

Environment Variables

Subsetzer understands both the new SUBSETZER_* variables and the legacy HOMEDOC_* names. The new aliases take precedence when both are set.

Variable Description Default
SUBSETZER_LLM_SERVER / HOMEDOC_LLM_SERVER Ollama server URL http://127.0.0.1:11434
SUBSETZER_LLM_MODEL / HOMEDOC_LLM_MODEL Model tag gemma3:12b
SUBSETZER_LLM_MODE / HOMEDOC_LLM_MODE auto, chat, or generate auto
SUBSETZER_STREAM / HOMEDOC_STREAM Enable streaming True
SUBSETZER_HTTP_TIMEOUT / HOMEDOC_HTTP_TIMEOUT Timeout in seconds 60
SUBSETZER_CUES_PER_REQUEST / HOMEDOC_CUES_PER_REQUEST Batch size 1
SUBSETZER_TZ / HOMEDOC_TZ Timezone for timestamped folders local time

Development

Clone the repository and install in editable mode:

pip install -e packages/subsetzer
pytest packages/subsetzer/tests

Subsetzer ships with type hints (py.typed) and avoids third-party dependencies.

License

GPL-3.0-or-later — see LICENSE for full details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subsetzer-0.1.2.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

subsetzer-0.1.2-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file subsetzer-0.1.2.tar.gz.

File metadata

  • Download URL: subsetzer-0.1.2.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for subsetzer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 72dc9eb6cb89bfa82c6226429b7fa1bf803124f3cf1cf0caa644db8613776c26
MD5 86d4e8719a16bf32d21ab294482d56ca
BLAKE2b-256 936b9ba96a32d857c7a8f827a1550afd0a390287b1b7f33895747d3e6288e743

See more details on using hashes here.

File details

Details for the file subsetzer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: subsetzer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for subsetzer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca50f6c8425795926bb0c972b17147b1640328a595f4b2a3b0328a5be98b48cc
MD5 e5efeb924b54f4acdbe5163adb5f4c4a
BLAKE2b-256 c075846b4b553aa3b541e31a62b37f0a781e21ea5051ed8ef73641d8a2b23467

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page