Typed, package-first Gemini subtitle translation and transcription
Project description
Srtx
Srtx is a typed, package-first Python library and CLI for translating SRT subtitles and transcribing audio or video with Google Gemini.
It is the clean, object-oriented successor to gemini-srt-translator.
Workflows live in reusable services, the Typer CLI is a thin adapter, and the
package has no GUI dependency.
Features
- SRT translation with preserved timing, formatting, and RTL text
- Audio and video transcription
- Embedded subtitle and speech-focused audio extraction
- Streaming Gemini responses and configurable generation controls
- AI Studio and Google Cloud Enterprise/Vertex authentication
- Resumable workflows with atomic checkpoints
- Token-aware batching, retries, API-key rotation, and recovery splitting
- Structured progress, operational logs, and safe explanatory events
- Reporter adapters for terminals, files, tests, and GUI applications
Quick start
Srtx requires Python 3.13 or newer. FFmpeg and ffprobe are required for media workflows.
python -m pip install srtx
export GEMINI_API_KEY="your-key"
srtx translate subtitles.srt --language French
srtx transcribe interview.mp4 --output interview.srt
srtx extract movie.mkv --subtitles
srtx models
Use Srtx as a library:
from pathlib import Path
from srtx.domain.settings import GeminiAuthSettings
from srtx.domain.translation import TranslationRequest, TranslationSettings
from srtx.infrastructure.gemini.factory import GeminiClientFactory
from srtx.infrastructure.subtitles import SrtRepository
from srtx.services.translation_service import TranslationService
client = GeminiClientFactory().create(
GeminiAuthSettings(api_key="your-key")
)
service = TranslationService(
subtitle_repository=SrtRepository(),
gemini_client=client,
token_counter=client,
)
result = service.translate(
TranslationRequest(
source_path=Path("input.srt"),
output_path=Path("output.srt"),
settings=TranslationSettings(target_language="French"),
)
)
Documentation
The Srtx wiki contains:
- Installation and authentication
- Complete CLI guide
- Using Srtx inside Python projects
- Translation, transcription, and media API guides
- Progress reporters and GUI integration
- Architecture, development, migration, and troubleshooting
Development
uv sync --all-groups
uv run pytest
uv run ruff check .
uv run pyright
uv build
License
Srtx is licensed under GPL-3.0-only.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file srtx-0.1.0.tar.gz.
File metadata
- Download URL: srtx-0.1.0.tar.gz
- Upload date:
- Size: 60.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd8156c6e2d7f4949b3045a4cd0779f3593d8e87086fe208c5748949a3c9bf99
|
|
| MD5 |
e908f658d98270ac303e84adbf37543e
|
|
| BLAKE2b-256 |
11ad42acf1afd7e80e1d64a1065aea81626a1238699d4262ff4b3e224b9b6a17
|
File details
Details for the file srtx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: srtx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 81.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d78e7d822098c3dd75a47c8a759524ea5f0435b436e891a0807d8239ba2e247a
|
|
| MD5 |
f1b14e15889edf727b25212f41732ce5
|
|
| BLAKE2b-256 |
ad2a299d629083d4b05cd919e65086e8de45cc754347fa2ab072018a0656696e
|