--- id: srt version: "3.5.3" license: MIT license_treatment: permissive maintenance: dormant --- # srt — A tiny library for parsing, modifying, and composing SRT files. License: permissive · Maintenance: dormant · Downloads: 689.3K/mo ## 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 above — 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 pip install srt uv add srt 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_current - Install friction: high - Maintenance: dormant - Downloads: 689.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags srt subtitle parser, parse srt files python, subtitle file manipulation, srt composer, broken srt repair, subtitle timing adjustment, srt file editor library, subtitle-processing, video-metadata [View on SkillFed](https://skillfed.io/packages/srt) · [View on PyPI](https://pypi.org/project/srt/)