--- id: pysubs2 version: "1.8.1" license: MIT license_treatment: permissive maintenance: active --- # pysubs2 — A library for editing subtitle files License: permissive · Maintenance: active · Downloads: 264.0K/mo ## What it is and what it does pysubs2 is a Python library for reading, editing, and writing subtitle files across multiple formats. It centers on SubStation Alpha (the native format of Aegisub) but also handles SubRip, MicroDVD, MPL2, TMP, WebVTT, TTML, SAMI, and OpenAI Whisper captions. The library provides both a programmatic API for subtitle manipulation—loading files, shifting timings, modifying text and styling—and a command-line tool for batch conversion and retiming tasks. The package has no external runtime dependencies, making installation straightforward. It is actively maintained, production-stable, and supports current Python versions. The MIT license places no restrictions on use, modification, or distribution. It is well-suited for developers building video processing pipelines, subtitle editors, or tools that need to work with captions in multiple formats. Use it for: - Batch convert subtitle files between formats (e.g., SRT to ASS) across a directory. - Programmatically adjust subtitle timings in response to video edits or synchronization issues. - Parse and modify subtitle text, styling, or metadata within a video processing workflow. - Integrate subtitle handling into a video editor or caption management application. - Process OpenAI Whisper-generated captions and convert them to standard subtitle formats. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pysubs2 loads, edits, and saves subtitle files in multiple formats including SubStation Alpha, SubRip, MicroDVD, MPL2, TMP, WebVTT, TTML, SAMI, and OpenAI Whisper captions, with a CLI tool for batch conversion and retiming. Yes. pysubs2 is a stable, actively maintained library with zero dependencies, broad format support, and a permissive license. Install it if you need to programmatically work with subtitles or build subtitle conversion and retiming tools. The low friction and production-ready status make it a straightforward choice for subtitle-related tasks. ## Install pip install pysubs2 uv add pysubs2 poetry add pysubs2 ## Installing pysubs2 Before you install: Low install friction with no runtime dependencies. Actively maintained with a recent release and ongoing commits; classifiers indicate production-stable status and support for current Python versions. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute pysubs2 freely provided you include the license notice. Quickstart: pip install pysubs2 import pysubs2 subs = pysubs2.load("my_subtitles.ass", encoding="utf-8") subs.shift(s=2.5) subs.save("my_subtitles_edited.ass") Requires Python 3.9 or later. Verify before relying: - Whether the library handles edge cases in format conversion (e.g., unsupported tags or malformed input) gracefully. - Performance characteristics when processing large subtitle files or batch operations. - Completeness of support for advanced SubStation Alpha features beyond basic text and timing. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 264.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags subtitle file editor, srt ass vtt conversion, batch subtitle retiming, subtitle format converter, subtitle text manipulation, subtitle timing adjustment, multi-format subtitle library, subtitle-editing, format-conversion, video-processing [View on SkillFed](https://skillfed.io/packages/pysubs2) · [View on PyPI](https://pypi.org/project/pysubs2/)