Skip to main content

A library for editing subtitle files

Project description

pysubs2 build master branch 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")
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.

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.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysubs2-1.6.0-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysubs2-1.6.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pysubs2-1.6.0.tar.gz
Algorithm Hash digest
SHA256 ed6ff66eaf7d3bc98bb0970c6cd4bf7042a70a2da6e804ff03be4cd9c3179a4f
MD5 ec13faaf1c689fe9c936b58e87c5a293
BLAKE2b-256 1088af17d4e9318b54aa2d7c566c2d94995f14f43b56be69c3813d75d0c7d7e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysubs2-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pysubs2-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20d8ebb85bc7d93702b22451a65095a21dbf7ed6f788526ee4c2fb4bf2272d48
MD5 45d5ec37e4cad6abdfdc829bcc62fa3e
BLAKE2b-256 9c36d0490b0e58c62bf59832e82a2b27573ea648920dd43b84610c30076b2478

See more details on using hashes here.

Supported by

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