Skip to main content

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


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.3.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file pysrt-0.1.3.tar.gz.

File metadata

  • Download URL: pysrt-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysrt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 780758671a20fd1919f0d8c9bd77b71027110f0871f3d0cdf35d2f580cc72e96
MD5 65827f81b8e5dc3731c0bf5a3462a146
BLAKE2b-256 d3ff771f9e6184cbd0b00e79398a1a1443970fbb79cb510eca4df2d419f59534

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page