Skip to main content

A powerful script to translate .srt files with concurrent processing support.

Project description

SRT Translator

Build Status License: MIT Python: 3.8+

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 --workers to 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 .env files for secure API key management.

🚀 Quick Start

Installation

  1. From PyPI (Recommended):

    pip install srt-translator-cli
    
  2. 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:

🛠 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


Download files

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

Source Distribution

srt_translator_cli-2026.5.30.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

srt_translator_cli-2026.5.30-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

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

Hashes for srt_translator_cli-2026.5.30.tar.gz
Algorithm Hash digest
SHA256 8381a61580727e9f4504ed0d215070c36dd1ca78bb54c500951f146532345009
MD5 216af67678a8e71e9fe9ff46c947028f
BLAKE2b-256 14a4fc38f102a18a430266b3708643186872ac724bf7d1235d966fa1dc898c6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for srt_translator_cli-2026.5.30.tar.gz:

Publisher: python-publish.yml on fam007e/srt_trans

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file srt_translator_cli-2026.5.30-py3-none-any.whl.

File metadata

File hashes

Hashes for srt_translator_cli-2026.5.30-py3-none-any.whl
Algorithm Hash digest
SHA256 37fa4b9df4cc5c37e5c22579954536872f0bd3554bfab8fffebcf3402143d684
MD5 889f4b2f68247dec6c4783061d2199c1
BLAKE2b-256 4aa8e8d294b9aa9b9285ddb6111c07f4ebe972ac7cd3cdf3527f4fe12f953ac4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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