A library for editing subtitle files
Project description
pysubs2
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
Release history Release notifications | RSS feed
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)
Built Distribution
pysubs2-1.7.3-py3-none-any.whl
(38.0 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0130f373390736754531be4e68a0fa521e825fa15cc8ff506e4f8ca2c17459a |
|
MD5 | 5981e999f219592fc78fe76ab08bf901 |
|
BLAKE2b-256 | 27f0c496409796d038e65161b8cddc6925d4c2c53489fb6f690eb28027ecc58a |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | de438c868d2c656781c4a78f220ec3a6fd6d52be49266c81fe912d2527002d44 |
|
MD5 | d418bef503d5881e320df78c3b37ba27 |
|
BLAKE2b-256 | f2471afe4b3ed63f5c50bfe1d3b2d97f2bdee36c6b3f05584d3c34f27c5d488c |