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.31.tar.gz (17.7 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.31-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file srt_translator_cli-2026.5.31.tar.gz.

File metadata

  • Download URL: srt_translator_cli-2026.5.31.tar.gz
  • Upload date:
  • Size: 17.7 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.31.tar.gz
Algorithm Hash digest
SHA256 ed765816f27211275e1379fc9530c41ef851d7ce10cdbc6f9a9d28bcc41039f7
MD5 c601dc189cb75cc32ed97f917fdc9597
BLAKE2b-256 7adc5e31ed6d9e83922dda2e8c7c75f60e28a0d893fecb62f77fd0085dbcad3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for srt_translator_cli-2026.5.31.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.31-py3-none-any.whl.

File metadata

File hashes

Hashes for srt_translator_cli-2026.5.31-py3-none-any.whl
Algorithm Hash digest
SHA256 8285d102ad6844246efae87ea4e91dda96fc920a2e60c4b13d8641272a754526
MD5 a54b4906a8de2e478988dc98a6bee74b
BLAKE2b-256 7dc16e852c940451591b0e7ee05c81e624a14c5214cdbe548d2e81d5e80be0ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for srt_translator_cli-2026.5.31-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