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, 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3397bb58a4a15b1325ba2ae3fd4d7c214e2c0ddb9f33190d6280d783bb433b20
|
|
| MD5 |
5dda2f8769c75debe06bcb8ccd99f561
|
|
| BLAKE2b-256 |
314abecf78d9d3df56e6c4a9c50b83794e5436b6c5ab6dd8a3f934e94c89338c
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05716f5039a9ebe32cd4d7673f923cf36204f3a3e99987f823ab83610b7035a0
|
|
| MD5 |
bb84d78e8917e1507e48032a75a6000d
|
|
| BLAKE2b-256 |
99090fc0719162e5ad723f71d41cf336f18b6b5054d70dc0fe42ace6b4d2bdc9
|