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, WebVTT, TTML and SAMI 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.8.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

pysubs2-1.8.0-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pysubs2-1.8.0.tar.gz
Algorithm Hash digest
SHA256 3397bb58a4a15b1325ba2ae3fd4d7c214e2c0ddb9f33190d6280d783bb433b20
MD5 5dda2f8769c75debe06bcb8ccd99f561
BLAKE2b-256 314abecf78d9d3df56e6c4a9c50b83794e5436b6c5ab6dd8a3f934e94c89338c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysubs2-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pysubs2-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05716f5039a9ebe32cd4d7673f923cf36204f3a3e99987f823ab83610b7035a0
MD5 bb84d78e8917e1507e48032a75a6000d
BLAKE2b-256 99090fc0719162e5ad723f71d41cf336f18b6b5054d70dc0fe42ace6b4d2bdc9

See more details on using hashes here.

Supported by

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