skillfed

pysrt

SubRip (.srt) subtitle parser and writer

pysrt v1.1.2 508.5K downloads/30d#6,278 on PyPI491
Copyleft license GPLv3 Abandoned released

What it is and what it does

pysrt is a Python library for reading, modifying, and writing SubRip subtitle files. It exposes subtitles as a list-like collection of editable items, each with text, start time, and end time properties. You can shift all subtitles forward or backward in time, rescale them to match different frame rates, slice ranges, or edit individual entries. The package also includes an srt command-line tool for common operations like time-shifting and frame-rate conversion without writing code.

The library is mature and stable but abandoned—the last release was in January 2020 and the repository shows no recent commits. It has no external runtime dependencies, making installation straightforward on systems with build tools. The GPLv3 license is copyleft, so derivative works must also be open-source. It is suitable for stable, read-only subtitle workflows but not recommended for projects requiring active maintenance or bug fixes.

Use it for:

  • Batch-shift subtitle timing across a media library to correct sync issues with video files.
  • Rescale subtitles from one frame rate to another (e.g., 23.9 fps to 25 fps) for format conversion.
  • Programmatically edit or filter subtitle text and timing in video processing pipelines.
  • Extract and manipulate subtitle metadata (start/end times, text) for analysis or re-encoding.
  • Command-line subtitle adjustment without writing code (srt shift, split, rate commands).

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pysrt parses, edits, and writes SubRip (.srt) subtitle files, offering both a Python library API and a command-line tool for shifting, splitting, and rescaling subtitles.

Yes, if your use case is stable and read-only (parsing, shifting, rescaling existing .srt files). The library is mature, dependency-free, and widely used. No, if you need active maintenance, bug fixes, or support for modern Python versions beyond what the classifiers claim. The GPLv3 license is a hard blocker for proprietary software. The high install friction (source-only) may complicate deployment on some platforms.

Install

pysrt on PyPI

pip

pip install pysrt

uv

uv add pysrt

poetry

poetry add pysrt

Installing pysrt

Before you install

High install friction due to source-only distribution (pysrt-1.1.2.tar.gz). Maintenance is abandoned—last release was 2020-01-20 and last commit 2023-05-09, with no active development. Suitable only for stable, read-only subtitle workflows.

License in practice

GPLv3 copyleft license requires that any derivative work or bundled distribution also be licensed under GPLv3. Acceptable for internal tools and open-source projects, but incompatible with proprietary software that cannot adopt copyleft terms.

Quickstart

pip install pysrt

import pysrt
subs = pysrt.open('movie.srt')
subs.shift(seconds=-2)
subs.save('movie_shifted.srt')

No runtime dependencies, but source-only distribution requires a C compiler or pre-built wheel availability on your platform.

Verify before relying

  • Whether the package works reliably on modern Python versions (3.10+) despite classifiers only listing up to 3.5.
  • Current state of encoding handling and whether it handles modern subtitle edge cases (emoji, complex markup).

Package facts

License GPLv3 (copyleft)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 2,398 days since the last release
Last repo commit
First released
Downloads 508,478/month — #6,278 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pysrt-1.1.2.tar.gz

Keywords: SubRip, srt, subtitle

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License (GPL)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Topic :: Multimedia :: VideoTopic :: Software Development :: LibrariesTopic :: Text Processing :: Markup

Tags

srt subtitle parsersubrip file editorsubtitle timing shiftsrt command line toolsubtitle file manipulationpython subtitle librarysrt rescale fps
subtitle-editingvideo-processingcli-tool

More Libraries packages