A powerful script to translate .srt files with concurrent processing support.
Project description
SRT Translator
A robust and feature-rich Python command-line tool for translating SubRip (SRT) subtitle files. Supports Google Translate, DeepL, and MyMemory with intelligent mixed-language handling, HTML tag preservation, and resilient error recovery.
✨ Features
- Modular Architecture: Easy to extend with new translation services.
- Multiple Services: Google Translate (default), DeepL, and MyMemory.
- Resilient Recovery: Automatic retries with exponential backoff and resume capability for interrupted translations.
- Parallel Processing: Use
--workersto speed up translation of large files. - Mixed-Language Handling: Sentence-level language detection for mixed subtitles.
- HTML Tag Preservation: Keeps
<i>,<b>, etc., styling intact. - Batch Processing: Translate multiple files or entire directories at once.
- Configuration: Support for
.envfiles for secure API key management.
🚀 Quick Start
Installation
-
From PyPI (Recommended):
pip install srt-translator-cli
-
From Source:
git clone https://github.com/fam007e/srt_trans.git cd srt_trans pip install .
Developer Setup
For developers wanting to run tests and build the package, we provide a Makefile:
# 1. Create venv
python -m venv .venv
# 2. Setup all dev/test dependencies
make setup
# 3. Run all checks (lint, type-check, tests)
make check
# 4. Build binary
make build
# 5. (Optional) Install in editable mode
pip install -e .
Basic Usage
srt-translator-cli movie.srt -t es
📚 Documentation
For more detailed information, please see our dedicated documentation:
- Usage Guide - Deep dive into CLI options and examples.
- API Reference - How to use SRT Translator as a library.
- Contributing - How to help improve this project.
🛠 Supported Languages
SRT Translator supports over 70 languages. Run the following command to see the full list:
srt-translator-cli --list-languages
⚖ License
This project is licensed under the MIT License. See the LICENSE file for details.
🙏 Acknowledgements
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 srt_translator_cli-2026.5.30.tar.gz.
File metadata
- Download URL: srt_translator_cli-2026.5.30.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8381a61580727e9f4504ed0d215070c36dd1ca78bb54c500951f146532345009
|
|
| MD5 |
216af67678a8e71e9fe9ff46c947028f
|
|
| BLAKE2b-256 |
14a4fc38f102a18a430266b3708643186872ac724bf7d1235d966fa1dc898c6d
|
Provenance
The following attestation bundles were made for srt_translator_cli-2026.5.30.tar.gz:
Publisher:
python-publish.yml on fam007e/srt_trans
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srt_translator_cli-2026.5.30.tar.gz -
Subject digest:
8381a61580727e9f4504ed0d215070c36dd1ca78bb54c500951f146532345009 - Sigstore transparency entry: 1674114900
- Sigstore integration time:
-
Permalink:
fam007e/srt_trans@4decf763074ff7d88966067a9a5bf16e387885d0 -
Branch / Tag:
refs/tags/v2026.05.30 - Owner: https://github.com/fam007e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4decf763074ff7d88966067a9a5bf16e387885d0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file srt_translator_cli-2026.5.30-py3-none-any.whl.
File metadata
- Download URL: srt_translator_cli-2026.5.30-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37fa4b9df4cc5c37e5c22579954536872f0bd3554bfab8fffebcf3402143d684
|
|
| MD5 |
889f4b2f68247dec6c4783061d2199c1
|
|
| BLAKE2b-256 |
4aa8e8d294b9aa9b9285ddb6111c07f4ebe972ac7cd3cdf3527f4fe12f953ac4
|
Provenance
The following attestation bundles were made for srt_translator_cli-2026.5.30-py3-none-any.whl:
Publisher:
python-publish.yml on fam007e/srt_trans
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srt_translator_cli-2026.5.30-py3-none-any.whl -
Subject digest:
37fa4b9df4cc5c37e5c22579954536872f0bd3554bfab8fffebcf3402143d684 - Sigstore transparency entry: 1674114903
- Sigstore integration time:
-
Permalink:
fam007e/srt_trans@4decf763074ff7d88966067a9a5bf16e387885d0 -
Branch / Tag:
refs/tags/v2026.05.30 - Owner: https://github.com/fam007e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4decf763074ff7d88966067a9a5bf16e387885d0 -
Trigger Event:
release
-
Statement type: