skip to navigation
skip to content

pysrt 0.1.3

SubRip (.srt) subtitle parser and writer

Latest Version: 0.2.2

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')
File Type Py Version Uploaded on Size # downloads
pysrt-0.1.3.tar.gz (md5) Source 2009-10-17 21:37:51.304727 3KB 59

Log in to rate this package.