Async SRT subtitle translator using OpenAI
Project description
SRT Translator
A tool that translates SRT subtitle files to any language using OpenAI's API. It processes subtitles asynchronously in batches for efficient translation while preserving timing and formatting.
CLI
subconv input.srt output.srt
Examples
subconv input.srt output.srt -t "Spanish"
subconv input.srt output.srt -s "English" -t "Japanese"
subconv input.srt output.srt --target-language "French" --source-language "German"
Options
| Option | Description | Default |
|---|---|---|
-t, --target-language |
Target language for translation | Brazilian Portuguese |
-s, --source-language |
Source language (optional) | Auto-detected |
-m, --model |
OpenAI model | gpt-4o-mini |
-c, --concurrent |
Max concurrent requests | 5 |
-b, --batch-size |
Subtitles per batch | 15 |
Library
import asyncio
from pathlib import Path
from subconv import TranslationConfig, TranslationService
config = TranslationConfig(
input_path=Path("input.srt"),
output_path=Path("output.srt"),
target_language="Spanish",
source_language="English",
)
asyncio.run(TranslationService(config).run())
Environment
export OPENAI_API_KEY=your-key
License
Tests and documentation generated by Claude xD
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
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 subconv-1.1.1.tar.gz.
File metadata
- Download URL: subconv-1.1.1.tar.gz
- Upload date:
- Size: 49.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a273e2d732d2aad9f610bb31c493e97cadcc3a488a306537dc90b55cda12aa36
|
|
| MD5 |
b9c9ec7efb22e48d988dd791f0fa89e3
|
|
| BLAKE2b-256 |
59f332857dd905209112e8e8c7d733f0ed21734841ba7f27d7ca6f1c96f4b46e
|
Provenance
The following attestation bundles were made for subconv-1.1.1.tar.gz:
Publisher:
publish.yml on vnniciusg/subconv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
subconv-1.1.1.tar.gz -
Subject digest:
a273e2d732d2aad9f610bb31c493e97cadcc3a488a306537dc90b55cda12aa36 - Sigstore transparency entry: 849256064
- Sigstore integration time:
-
Permalink:
vnniciusg/subconv@edef92b1ed1062c071d443dbf72f108cec06f6a7 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/vnniciusg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@edef92b1ed1062c071d443dbf72f108cec06f6a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file subconv-1.1.1-py3-none-any.whl.
File metadata
- Download URL: subconv-1.1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99d3ea0a7bb488a48e230a2b078626eb007a120aa9219f24e32486fee48d00c8
|
|
| MD5 |
8bc1e4a0e77f81204b6a46bbe2214b7b
|
|
| BLAKE2b-256 |
d6f0931bebccdc482e754b7b54095d1ce4b34ffc201d20d475b19b7343de1e38
|
Provenance
The following attestation bundles were made for subconv-1.1.1-py3-none-any.whl:
Publisher:
publish.yml on vnniciusg/subconv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
subconv-1.1.1-py3-none-any.whl -
Subject digest:
99d3ea0a7bb488a48e230a2b078626eb007a120aa9219f24e32486fee48d00c8 - Sigstore transparency entry: 849256073
- Sigstore integration time:
-
Permalink:
vnniciusg/subconv@edef92b1ed1062c071d443dbf72f108cec06f6a7 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/vnniciusg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@edef92b1ed1062c071d443dbf72f108cec06f6a7 -
Trigger Event:
push
-
Statement type: