Skip to main content

A library for editing subtitle files

Project description

pysubs2 build master branch pysubs2 test code coverage MyPy checked PyPI - Version PyPI - Status PyPI - Python Version PyPI - License

pysubs2 is a Python library for editing subtitle files. It’s based on SubStation Alpha, the native format of Aegisub; 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.

$ pip install pysubs2
$ pysubs2 --shift 0.3s *.srt
$ pysubs2 --to srt *.ass
import pysubs2
subs = pysubs2.load("my_subtitles.ass", encoding="utf-8")
for line in subs:
    line.text = "{\\be1}" + line.text"my_subtitles_edited.ass")

To learn more, please see the documentation. If you’d like to contribute, see

pysubs2 is licensed under the MIT license (see LICENSE.txt).

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

pysubs2-1.6.1.tar.gz (42.5 kB view hashes)

Uploaded source

Built Distribution

pysubs2-1.6.1-py3-none-any.whl (35.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page