AI Based Subtitle Translator - transitle ===============================
Transitle is a AI-based subtitle translator. It allows you to translate subtitles in a directory flawlessly with your favorite translator. Translate bunch of subtitlesfrom original language to desired language. This gives you a AI-based translated subtitle.
Transitle also has support for using AI-based translator such as:
pip install transitle
To run the translater
install the transitle via pip pip install transitle
you must have a valid subtitle in .srt format
You can use Google translator or yandex
For yandex you must have Yandex Translater API key. You can get it from here: http://api.yandex.com/key/keyslist.xml
Translators
There buch of translators including AI-based translation Deepl. You can register and create a API token and then put it in the environment variables. Most of the toolings provide free limited translation.
Alternative translators:
google
chatgpt
microsoft
pons
linguee
mymemory
yandex
papago
deepl
qcri
Run as a CLI tooling
➜ ~ pip install transitle
➜ ~ ts ~/Downloads/subtitles google en tr
- - - - - - - - Translating: sample.srt - - - - - - - -
1
00:00:09,750 --> 00:00:10,666
<i>São Paulo,</i>
2
00:00:10,750 --> 00:00:13,166
<i>neredeyse 13 milyon kişi.</i>
Use as a library
# translate subtitles in a path
>>> from transitle import ts
>>> ts('/Users/mesutgunes/Downloads/subtitles', 'google', 'en', 'tr')
- - - - - - - - Translating: sample.srt - - - - - - - -
1
00:00:09,750 --> 00:00:10,666
<i>São Paulo,</i>
2
00:00:10,750 --> 00:00:13,166
<i>neredeyse 13 milyon kişi.</i>
3
00:00:13,250 --> 00:00:16,583
<i>Hikayemin bu kısmı burada başladı.
sonbaharda.</i>
# translate a subtitle
>>> from translate_subtitles import TranslateSubtitle
>>> tr = TranslateSubtitle()
>>> tr.subtitle_translator('/Users/mesutgunes/Downloads/subtitles/sample.srt', 'google', 'en', 'tr')
- - - - - - - - Translating: sample.srt - - - - - - - -
1
00:00:09,750 --> 00:00:10,666
<i>São Paulo,</i>
2
00:00:10,750 --> 00:00:13,166
<i>neredeyse 13 milyon kişi.</i>
Local Development
Make sure you have Python 2.7 or above installed Check Python:
python --version
Clone the project:
>>> git clone https://github.com/gunesmes/subtitle_translator.git
# edit code and install it
>>> pip3 install .
# use it as normal
>>> ts('/Users/mesutgunes/Downloads/subtitles', 'google', 'en', 'tr')
Don’t wory about source language, translater can understand it. (not released)
Check language abbreviation: https://developers.google.com/translate/v2/using_rest#language-params
The .srt files in the given directory are to be translated to target language
Metadata
Release files for translate-subtitles 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| translate_subtitles-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for translate_subtitles-1.1.1-py3-none-any.whl |
Release files / translate_subtitles-1.1.1-py3-none-any.whl
| Download URL | translate_subtitles-1.1.1-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
043165d8abfbf39fb56cfb76d2ed29ddfdf128489dd4282d779efa0c3869e7dc
|
|
BLAKE2b-256 checksum How to use checksums |
98388a778e6ccd1805cee2912cecf6d7f282fb9cf553ab6be5e4f606748bd3ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.8
|
Security for translate-subtitles 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.