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

Uploaded Source

Built Distribution

pysubs2-1.7.3-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pysubs2-1.7.3.tar.gz
Algorithm Hash digest
SHA256 b0130f373390736754531be4e68a0fa521e825fa15cc8ff506e4f8ca2c17459a
MD5 5981e999f219592fc78fe76ab08bf901
BLAKE2b-256 27f0c496409796d038e65161b8cddc6925d4c2c53489fb6f690eb28027ecc58a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pysubs2-1.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 de438c868d2c656781c4a78f220ec3a6fd6d52be49266c81fe912d2527002d44
MD5 d418bef503d5881e320df78c3b37ba27
BLAKE2b-256 f2471afe4b3ed63f5c50bfe1d3b2d97f2bdee36c6b3f05584d3c34f27c5d488c

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