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.1.tar.gz
(1.1 MB
view details)
Built Distribution
pysubs2-1.7.1-py3-none-any.whl
(37.8 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ec117bf96efae21a9810838aca35134de8600b49a6e445a1933b2a3e037240 |
|
MD5 | ce2c91c42e1379d1e114d99d6399ade2 |
|
BLAKE2b-256 | d1cd309b63ee53e9ead3305d4f622ee3c57b02633da251877b8ab959db6360f0 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0077a0889f6e12a580844c0a810f27cc4a574f2842784ad500915e8380c9b75 |
|
MD5 | d5732cd4df2d6940c6dc523edfe1466a |
|
BLAKE2b-256 | fe7072c88ac39c14d11405121b5641063c75f91c27bed6f37522f503e077cc11 |