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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysubs2-1.7.1.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.1.tar.gz
Algorithm Hash digest
SHA256 94ec117bf96efae21a9810838aca35134de8600b49a6e445a1933b2a3e037240
MD5 ce2c91c42e1379d1e114d99d6399ade2
BLAKE2b-256 d1cd309b63ee53e9ead3305d4f622ee3c57b02633da251877b8ab959db6360f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysubs2-1.7.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0077a0889f6e12a580844c0a810f27cc4a574f2842784ad500915e8380c9b75
MD5 d5732cd4df2d6940c6dc523edfe1466a
BLAKE2b-256 fe7072c88ac39c14d11405121b5641063c75f91c27bed6f37522f503e077cc11

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