skip to navigation
skip to content

pysrt 0.2.2

SubRip (.srt) subtitle parser and writer

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].text = "Never end !"

#equivalent
part = subs.slice(ends_after=SubRipTime(0, 0, 40))
part = subs.slice(ends_after=(0, 0, 40))
part = subs.slice(ends_after={'seconds': 40})

part.shift(seconds=-2)
subs.save('other/path.srt', 'utf-8')
File Type Py Version Uploaded on Size # downloads
pysrt-0.2.2-py2.5.egg (md5) Python Egg 2.5 2009-11-07 19:15:12.333864 23KB 27
pysrt-0.2.2-py2.6.egg (md5) Python Egg 2.6 2009-11-07 19:14:27.933115 23KB 28
pysrt-0.2.2.tar.gz (md5) Source 2009-11-07 19:14:25.855724 7KB 40

Log in to rate this package.