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:
* `deepl <https://www.deepl.com/translator>`_
* `google <https://translate.google.com/>`_
* `mymemory <https://mymemory.ai/>`_
* `papago <https://papago.naver.com/>`_
* `qcri <https://mt.qcri.org/api/>`_
``pip install transitle``
.. image:: img/tty.gif
:align: center
:alt: Subtitle Demo Gif
:width: 600px
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
--------------------
.. code:: shell
➜ ~ 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
----------------
.. code:: shell
# 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:
.. code:: shell
python --version
Clone the project:
.. code:: shell
>>> 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
Raw data
{
"_id": null,
"home_page": "https://github.com/gunesmes/subtitle_translator",
"name": "translate-subtitles",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": null,
"keywords": null,
"author": "Mesut Gunes",
"author_email": "gunesmes@gmail.com",
"download_url": null,
"platform": null,
"description": "\n\nAI Based Subtitle Translator - transitle ===============================\n\nTransitle is a AI-based subtitle translator. It allows you to translate\nsubtitles in a directory flawlessly with your favorite translator.\nTranslate bunch of subtitlesfrom original language to desired language.\nThis gives you a AI-based translated subtitle.\n\nTransitle also has support for using AI-based translator such as:\n\n\n* `deepl <https://www.deepl.com/translator>`_\n* `google <https://translate.google.com/>`_\n* `mymemory <https://mymemory.ai/>`_\n* `papago <https://papago.naver.com/>`_\n* `qcri <https://mt.qcri.org/api/>`_\n\n``pip install transitle``\n\n.. image:: img/tty.gif\n :align: center\n :alt: Subtitle Demo Gif\n :width: 600px\n\nTo run the translater\n=====================\n\n\n* install the ``transitle`` via pip ``pip install transitle``\n* you must have a valid subtitle in .srt format\n* You can use Google translator or yandex\n* For yandex you must have Yandex Translater API key. You can get it\n from here: http://api.yandex.com/key/keyslist.xml\n\nTranslators\n-----------\n\nThere buch of translators including AI-based translation Deepl. You can\nregister and create a API token and then put it in the environment\nvariables. Most of the toolings provide free limited translation.\n\nAlternative translators:\n\n\n* google\n* chatgpt\n* microsoft\n* pons\n* linguee\n* mymemory\n* yandex\n* papago\n* deepl\n* qcri\n\nRun as a CLI tooling\n--------------------\n\n.. code:: shell\n\n \u279c ~ pip install transitle\n \u279c ~ ts ~/Downloads/subtitles google en tr\n\n - - - - - - - - Translating: sample.srt - - - - - - - -\n 1\n 00:00:09,750 --> 00:00:10,666\n <i>S\u00e3o Paulo,</i>\n\n 2\n 00:00:10,750 --> 00:00:13,166\n <i>neredeyse 13 milyon ki\u015fi.</i>\n\nUse as a library\n----------------\n\n.. code:: shell\n\n # translate subtitles in a path\n >>> from transitle import ts\n >>> ts('/Users/mesutgunes/Downloads/subtitles', 'google', 'en', 'tr')\n\n - - - - - - - - Translating: sample.srt - - - - - - - -\n 1\n 00:00:09,750 --> 00:00:10,666\n <i>S\u00e3o Paulo,</i>\n\n 2\n 00:00:10,750 --> 00:00:13,166\n <i>neredeyse 13 milyon ki\u015fi.</i>\n\n 3\n 00:00:13,250 --> 00:00:16,583\n <i>Hikayemin bu k\u0131sm\u0131 burada ba\u015flad\u0131.\n sonbaharda.</i>\n\n # translate a subtitle\n >>> from translate_subtitles import TranslateSubtitle\n >>> tr = TranslateSubtitle()\n >>> tr.subtitle_translator('/Users/mesutgunes/Downloads/subtitles/sample.srt', 'google', 'en', 'tr')\n\n - - - - - - - - Translating: sample.srt - - - - - - - -\n 1\n 00:00:09,750 --> 00:00:10,666\n <i>S\u00e3o Paulo,</i>\n\n 2\n 00:00:10,750 --> 00:00:13,166\n <i>neredeyse 13 milyon ki\u015fi.</i>\n\nLocal Development\n=================\n\nMake sure you have Python 2.7 or above installed Check Python:\n\n.. code:: shell\n\n python --version\n\nClone the project:\n\n.. code:: shell\n\n >>> git clone https://github.com/gunesmes/subtitle_translator.git\n\n # edit code and install it\n >>> pip3 install . \n\n # use it as normal\n >>> ts('/Users/mesutgunes/Downloads/subtitles', 'google', 'en', 'tr') \n\n\n* Don't wory about source language, translater can understand it. (not\n released)\n* Check language abbreviation:\n https://developers.google.com/translate/v2/using_rest#language-params\n* The .srt files in the given directory are to be translated to target\n language\n",
"bugtrack_url": null,
"license": "LICENSE.md",
"summary": "AI-Based Subtitle translator. Translate subtitles in a folder flawlessly",
"version": "1.1.1",
"project_urls": {
"Homepage": "https://github.com/gunesmes/subtitle_translator"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "98388a778e6ccd1805cee2912cecf6d7f282fb9cf553ab6be5e4f606748bd3ac",
"md5": "27f5459da2a01ec2a2cb5e66dd653df4",
"sha256": "043165d8abfbf39fb56cfb76d2ed29ddfdf128489dd4282d779efa0c3869e7dc"
},
"downloads": -1,
"filename": "translate_subtitles-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "27f5459da2a01ec2a2cb5e66dd653df4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0",
"size": 18787,
"upload_time": "2024-05-29T08:05:20",
"upload_time_iso_8601": "2024-05-29T08:05:20.159724Z",
"url": "https://files.pythonhosted.org/packages/98/38/8a778e6ccd1805cee2912cecf6d7f282fb9cf553ab6be5e4f606748bd3ac/translate_subtitles-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-29 08:05:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gunesmes",
"github_project": "subtitle_translator",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "translate-subtitles"
}