skillfed

srt

A tiny library for parsing, modifying, and composing SRT files.

srt v3.5.3 689.3K downloads/30d#5,337 on PyPI535
Permissive license MIT DORMANT released

What it is and what it does

srt is a minimal Python library for working with SubRip subtitle files. It provides parsing, modification, and composition of SRT files through a simple object-oriented API, converting raw SRT text into Subtitle objects you can inspect and edit, then serialize back to SRT format. The library is designed to handle real-world SRT files that may be malformed or use non-standard formats, including Asian-style (fullwidth) variants.

The package includes both a library API and command-line tools for common subtitle tasks like filtering, time-shifting, and multiplexing. It has no external dependencies beyond the Python standard library, making it lightweight and portable across Linux, macOS, and Windows. The codebase is small (~200 lines excluding docstrings) with high test coverage, and it has been used in production by projects like subsync, NVIDIA RAD-TTS, and manim.

Use it for:

  • Parse and extract subtitle timing and content from SRT files for video processing pipelines.
  • Repair or normalize malformed SRT files that other parsers reject, then re-export them.
  • Adjust subtitle timing (shift, scale) programmatically before re-encoding or remuxing.
  • Filter or transform subtitle lines based on language or content criteria using the included CLI tools.
  • Build subtitle manipulation features into video editing or transcription applications.

Worth the install?

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

Parse, modify, and compose SRT subtitle files with support for broken or malformed files and Asian-style formats.

Yes, if you need to work with SRT files. The library is stable, well-tested, and has no dependencies. High install friction (source distribution) is a minor drawback, but the package is lightweight and dormant maintenance is acceptable for a mature, focused tool. No security vulnerabilities and permissive licensing make it a low-risk choice.

Install

srt on PyPI

pip

pip install srt

uv

uv add srt

poetry

poetry add srt

Installing srt

Before you install

High install friction due to source distribution; however, the package has no runtime dependencies and is extremely lightweight. Maintenance is dormant (last release 2023-03-28, last commit 2024-03-19), but the library is stable and has been in production use since its early releases.

License in practice

Released under MIT, a permissive license allowing commercial and private use with minimal restrictions—no licensing concerns for most projects.

Quickstart

pip install srt

import srt

data = """1
00:00:33,843 --> 00:00:38,097
Subtitle text"""

for sub in srt.parse(data):
    print(sub.content)

output = srt.compose(srt_objects)

Verify before relying

  • Whether the source distribution (tar.gz) requires compilation or has platform-specific build requirements beyond standard Python tooling.
  • Current compatibility with Python versions beyond 3.11, given the dormant maintenance status.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=2.7)
Install friction high — source build required
Runtime dependencies none
Maintenance dormant — 1,235 days since the last release
Last repo commit
First released
Downloads 689,259/month — #5,337 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: srt-3.5.3.tar.gz

Keywords: srt

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: VideoTopic :: Software Development :: LibrariesTopic :: Text Processing

Tags

srt subtitle parserparse srt files pythonsubtitle file manipulationsrt composerbroken srt repairsubtitle timing adjustmentsrt file editor library
subtitle-processingvideo-metadata

More Libraries packages