{"id":13825491,"url":"https://github.com/sinedie/SRTranslator","last_synced_at":"2025-07-08T22:31:22.080Z","repository":{"id":65143803,"uuid":"583170397","full_name":"sinedie/SRTranslator","owner":"sinedie","description":"SRT files translator","archived":false,"fork":false,"pushed_at":"2024-10-18T01:48:12.000Z","size":617,"stargazers_count":214,"open_issues_count":2,"forks_count":25,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-20T12:32:21.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinedie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-29T01:19:33.000Z","updated_at":"2024-10-18T22:06:05.000Z","dependencies_parsed_at":"2024-02-03T23:20:14.433Z","dependency_job_id":"971b4a6e-3e19-4559-9e5c-48481ddfc047","html_url":"https://github.com/sinedie/SRTranslator","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":0.1351351351351351,"last_synced_commit":"93cc8df12725b05f939ddf908f9ae4ff9a96604a"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedie%2FSRTranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedie%2FSRTranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedie%2FSRTranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedie%2FSRTranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinedie","download_url":"https://codeload.github.com/sinedie/SRTranslator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470631,"owners_count":17479366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:01:22.084Z","updated_at":"2024-11-20T04:30:28.652Z","avatar_url":"https://github.com/sinedie.png","language":"Python","readme":"# SRTranslator\n\n## Install\n\n[PyPI](https://pypi.org/project/srtranslator/)\n\n```bash\npip install srtranslator\n```\n\n## Usage in Blender\n\n[tin2tin](https://github.com/tin2tin) has made this [blender addon](https://github.com/tin2tin/import_subtitles). Check it out.\n\n## Usage from script\n\nImport stuff\n\n```python\nimport os\n\n# SRT File\nfrom srtranslator import SrtFile\n# ASS File\nfrom srtranslator import AssFile\n\nfrom srtranslator.translators.deepl_api import DeeplApi\nfrom srtranslator.translators.deepl_scrap import DeeplTranslator\nfrom srtranslator.translators.translatepy import TranslatePy\nfrom srtranslator.translators.pydeeplx import PyDeepLX\n```\n\nInitialize translator. It can be any translator, even your own, check the docs, there are instructions per translator and how to create your own.\n\n```python\ntranslator = DeeplTranslator() # or TranslatePy() or DeeplApi(api_key) or DeepLX()\n```\n\nLoad, translate and save. For multiple recursive files in folder, check `examples folder`\n\n```python\nfilepath = \"./filepath/to/srt\"\n\n# SRT File\nsub = SrtFile(filepath)\n# ASS File\nsub = AssFile(filepath)\n\n# Translate\nsub.translate(translator, \"en\", \"es\")\n\n# Making the result subtitles prettier\nsub.wrap_lines()\n\nsub.save(f\"{os.path.splitext(filepath)[0]}_translated.srt\")\n```\n\nQuit translator\n\n```python\ntranslator.quit()\n```\n\n## Usage from GUI\n\nSince release V0.3.9 there is a new GUI powered by flet (a python-flutter framework) on folder ./GUI\n\n![image](./GUI/assets/screen_shot.png)\n\nThere is an artifact for linux and windows in the lastest github actions run.\n\n#### Package from source\n\nif you prefer to pack your own you could go to GUI folder, install the requirements and run `flet pack main.py` and copy assets folder\n\n```\ncd ./GUI\npip install -r requirements.txt\npip install pyinstaller\nflet pack main.py\ncp -r ./assets ./dist/assets\n```\n\nBinaries found in `dist` folder\n\n#### Alternatives\n\n[KryptoST](https://github.com/KryptoST) has made a graphical user interface. You can check it out [here](https://github.com/KryptoST/SRTranslatorGUI)\n\n## Usage command line\n\n```bash\n# SRT file\npython -m srtranslator ./filepath/to/srt -i SRC_LANG -o DEST_LANG\n\n# ASS file\npython -m srtranslator ./filepath/to/ass -i SRC_LANG -o DEST_LANG\n```\n\n## Advanced usage\n\n```\nusage: __main__.py [-h] [-i SRC_LANG] [-o DEST_LANG] [-v] [-vv] [-s] [-w WRAP_LIMIT] [-t {deepl-scrap,translatepy,deepl-api,pydeeplx}] [--auth AUTH] path\n\nTranslate an .STR and .ASS file\n\npositional arguments:\n  path                  File to translate\n\noptions:\n  -h, --help            show this help message and exit\n  -i SRC_LANG, --src-lang SRC_LANG\n                        Source language. Default: auto\n  -o DEST_LANG, --dest-lang DEST_LANG\n                        Destination language. Default: es (spanish)\n  -v, --verbose         Increase output verbosity\n  -vv, --debug          Increase output verbosity for debugging\n  -s, --show-browser    Show browser window\n  -w WRAP_LIMIT, --wrap-limit WRAP_LIMIT\n                        Number of characters -including spaces- to wrap a line of text. Default: 50\n  -t {deepl-scrap,translatepy,deepl-api}, --translator {deepl-scrap,translatepy,deepl-api,pydeeplx}\n                        Built-in translator to use\n  --auth AUTH           Api key if needed on translator\n  --proxies             Use proxy by default for pydeeplx\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinedie%2FSRTranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinedie%2FSRTranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinedie%2FSRTranslator/lists"}