Skip to main content

A library for editing subtitle files

Project description

pysubs2

pysubs2 build master branch pysubs2 test code coverage Static Badge PyPI - Version PyPI - Status PyPI - Python Version PyPI - License GitHub Repo stars

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")
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. If you'd like to contribute, see CONTRIBUTING.md.

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.7.2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

pysubs2-1.7.2-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file pysubs2-1.7.2.tar.gz.

File metadata

  • Download URL: pysubs2-1.7.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for pysubs2-1.7.2.tar.gz
Algorithm Hash digest
SHA256 b708904269cb252dbc51de75a372e04ab00c368939bb8220f7b0f940d978725e
MD5 e9d521222fafebee7bbbd478117930fe
BLAKE2b-256 1f72e9d8ac5aeb431bd49666fb49a6f6cdabfa040917a95a320e0f75d22b694e

See more details on using hashes here.

File details

Details for the file pysubs2-1.7.2-py3-none-any.whl.

File metadata

  • Download URL: pysubs2-1.7.2-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for pysubs2-1.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6de61539df485f8d4ad0c5b737f2dc1f2a9c65afcbe93177ebff25815163865
MD5 9ec3978f25fa7f7fab4bcb063f4a0901
BLAKE2b-256 6d120776c60505c8848342be8a47b837242cc4978c9923a863b0bc3bdee3f0c2

See more details on using hashes here.

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