SubRip (.srt) subtitle parser and writer
Project description
pysrt is a Python library used to edit or create SubRip files.
Usage
from pysrt import SubRipFile, SubRipItem, SubRipTime subs = SubRipFile('some/file.srt') subs[42].end.hours += 3 subs[42].sub_title = "Never end !" #equivalent part = SubRipFile(i for i in subs if i.end > SubRipTime(0, 0, 40)) part = SubRipFile(i for i in subs if i.end > (0, 0, 40)) part = SubRipFile(i for i in subs if i.end > {'seconds': 40}) part.shift(seconds=-2) subs.save('other/path.srt', 'utf-8')
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
pysrt-0.1.5.tar.gz
(3.8 kB
view details)
File details
Details for the file pysrt-0.1.5.tar.gz
.
File metadata
- Download URL: pysrt-0.1.5.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5edb3e407fffe78285e93e85d01b28c403f241434754b553eb0be1f5a8d5063 |
|
MD5 | 9b7f90fae9f43cbf354c63446c4b44e1 |
|
BLAKE2b-256 | 5e12d6a917e59a62f7ac09f9842ff3daefa8b8bff7b8361b0b1061d46822b5dd |