pysubs2
=======
[![pysubs2 build master branch](https://img.shields.io/github/actions/workflow/status/tkarabela/pysubs2/main.yml?branch=master)](https://github.com/tkarabela/pysubs2/actions)
[![pysubs2 test code coverage](https://img.shields.io/codecov/c/github/tkarabela/pysubs2)](https://app.codecov.io/github/tkarabela/pysubs2)
[![Static Badge](https://img.shields.io/badge/MyPy%20%26%20Ruffle-checked-blue?style=flat)](https://github.com/tkarabela/pysubs2/actions)
[![PyPI - Version](https://img.shields.io/pypi/v/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)
[![PyPI - Status](https://img.shields.io/pypi/status/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)
[![PyPI - License](https://img.shields.io/pypi/l/pysubs2.svg?style=flat)](LICENSE.txt)
[![GitHub Repo stars](https://img.shields.io/github/stars/tkarabela/pysubs2?style=flat&label=GitHub%20stars)](https://github.com/tkarabela/pysubs2)
pysubs2 is a Python library for editing subtitle files.
It’s based on *SubStation Alpha*, the native format of
[Aegisub](http://www.aegisub.org/); it also supports *SubRip (SRT)*,
*MicroDVD*, *MPL2*, *TMP* and *WebVTT* formats and *OpenAI Whisper* captions.
There is a small CLI tool for batch conversion and retiming.
```bash
pip install pysubs2
pysubs2 --shift 0.3s *.srt
pysubs2 --to srt *.ass
```
```python
import pysubs2
subs = pysubs2.load("my_subtitles.ass", encoding="utf-8")
subs.shift(s=2.5)
for line in subs:
line.text = "{\\be1}" + line.text
subs.save("my_subtitles_edited.ass")
```
To learn more, please [see the documentation](http://pysubs2.readthedocs.io).
If you'd like to contribute, see [CONTRIBUTING.md](CONTRIBUTING.md).
pysubs2 is licensed under the MIT license (see [LICENSE.txt](LICENSE.txt)).
Raw data
{
"_id": null,
"home_page": "https://github.com/tkarabela/pysubs2",
"name": "pysubs2",
"maintainer": null,
"docs_url": "https://pythonhosted.org/pysubs2/",
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "SubStation, SubRip, MicroDVD, MPL2, WebVTT, ass, srt, sub, vtt, subtitles, captions",
"author": "Tomas Karabela",
"author_email": "tkarabela@seznam.cz",
"download_url": "https://files.pythonhosted.org/packages/27/f0/c496409796d038e65161b8cddc6925d4c2c53489fb6f690eb28027ecc58a/pysubs2-1.7.3.tar.gz",
"platform": null,
"description": "pysubs2\n=======\n\n[![pysubs2 build master branch](https://img.shields.io/github/actions/workflow/status/tkarabela/pysubs2/main.yml?branch=master)](https://github.com/tkarabela/pysubs2/actions)\n[![pysubs2 test code coverage](https://img.shields.io/codecov/c/github/tkarabela/pysubs2)](https://app.codecov.io/github/tkarabela/pysubs2)\n[![Static Badge](https://img.shields.io/badge/MyPy%20%26%20Ruffle-checked-blue?style=flat)](https://github.com/tkarabela/pysubs2/actions)\n[![PyPI - Version](https://img.shields.io/pypi/v/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)\n[![PyPI - Status](https://img.shields.io/pypi/status/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)\n[![PyPI - License](https://img.shields.io/pypi/l/pysubs2.svg?style=flat)](LICENSE.txt)\n[![GitHub Repo stars](https://img.shields.io/github/stars/tkarabela/pysubs2?style=flat&label=GitHub%20stars)](https://github.com/tkarabela/pysubs2)\n\n\npysubs2 is a Python library for editing subtitle files.\nIt\u2019s based on *SubStation Alpha*, the native format of\n[Aegisub](http://www.aegisub.org/); it also supports *SubRip (SRT)*,\n*MicroDVD*, *MPL2*, *TMP* and *WebVTT* formats and *OpenAI Whisper* captions.\n\nThere is a small CLI tool for batch conversion and retiming.\n\n```bash\npip install pysubs2\npysubs2 --shift 0.3s *.srt\npysubs2 --to srt *.ass\n```\n\n```python\nimport pysubs2\nsubs = pysubs2.load(\"my_subtitles.ass\", encoding=\"utf-8\")\nsubs.shift(s=2.5)\nfor line in subs:\n line.text = \"{\\\\be1}\" + line.text\nsubs.save(\"my_subtitles_edited.ass\")\n```\n\nTo learn more, please [see the documentation](http://pysubs2.readthedocs.io).\nIf you'd like to contribute, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\npysubs2 is licensed under the MIT license (see [LICENSE.txt](LICENSE.txt)).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library for editing subtitle files",
"version": "1.7.3",
"project_urls": {
"Bug Tracker": "https://github.com/tkarabela/pysubs2/issues",
"Documentation": "https://pysubs2.readthedocs.io",
"Homepage": "https://github.com/tkarabela/pysubs2"
},
"split_keywords": [
"substation",
" subrip",
" microdvd",
" mpl2",
" webvtt",
" ass",
" srt",
" sub",
" vtt",
" subtitles",
" captions"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f2471afe4b3ed63f5c50bfe1d3b2d97f2bdee36c6b3f05584d3c34f27c5d488c",
"md5": "d418bef503d5881e320df78c3b37ba27",
"sha256": "de438c868d2c656781c4a78f220ec3a6fd6d52be49266c81fe912d2527002d44"
},
"downloads": -1,
"filename": "pysubs2-1.7.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d418bef503d5881e320df78c3b37ba27",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 37971,
"upload_time": "2024-07-26T22:01:02",
"upload_time_iso_8601": "2024-07-26T22:01:02.704838Z",
"url": "https://files.pythonhosted.org/packages/f2/47/1afe4b3ed63f5c50bfe1d3b2d97f2bdee36c6b3f05584d3c34f27c5d488c/pysubs2-1.7.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27f0c496409796d038e65161b8cddc6925d4c2c53489fb6f690eb28027ecc58a",
"md5": "5981e999f219592fc78fe76ab08bf901",
"sha256": "b0130f373390736754531be4e68a0fa521e825fa15cc8ff506e4f8ca2c17459a"
},
"downloads": -1,
"filename": "pysubs2-1.7.3.tar.gz",
"has_sig": false,
"md5_digest": "5981e999f219592fc78fe76ab08bf901",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1123849,
"upload_time": "2024-07-26T22:01:04",
"upload_time_iso_8601": "2024-07-26T22:01:04.643623Z",
"url": "https://files.pythonhosted.org/packages/27/f0/c496409796d038e65161b8cddc6925d4c2c53489fb6f690eb28027ecc58a/pysubs2-1.7.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-26 22:01:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tkarabela",
"github_project": "pysubs2",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pysubs2"
}