Skip to main content

A library for editing subtitle files

Project description

pysubs2 build master branch pysubs2 test code coverage 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. 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.6.1.tar.gz (42.5 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.1-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pysubs2-1.6.1.tar.gz
Algorithm Hash digest
SHA256 0261611e71735ff7763972c519c72593c8063efcb9039c54af65f31b81cec116
MD5 ec8f6be231ff86ff323aa898486e3105
BLAKE2b-256 223efb1b08a06144ba63f19cc4758dd72e2eb8c7fc95c6c8364faccfc570c7bf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pysubs2-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f96d9dfb5f859a54a00e04621beb20ff21ea1d788821b2f4935c5c0ef8dc68e
MD5 5d904002f86c13d71354c866be1370ca
BLAKE2b-256 4fdcdc1763a3abab92af2253b1abb3dd48e07b2a3613d7ae64a3ab5c27da3019

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