webvtt-py
WebVTT reader, writer and segmenter
What it is and what it does
webvtt-py is a lightweight Python library for working with WebVTT caption files—the standard subtitle format for web video. It lets you read captions from .vtt files, write them back out, and convert from SubRip (.srt) and YouTube SBV (.sbv) formats. The library also includes a segmentation feature for HLS video streaming, which splits captions into chunks aligned with video segments.
The package has no external runtime dependencies, making it quick to install. It supports Python 3.7 through 3.12 and offers both a Python API and a command-line interface for caption segmentation. The codebase is stable but dormant—last updated 806 days ago—so it's best suited for straightforward caption I/O tasks rather than projects requiring active maintenance.
Use it for:
- Parse and extract timing and text from existing WebVTT caption files for analysis or re-use.
- Convert subtitle files from SubRip or YouTube SBV format to WebVTT for web video playback.
- Segment captions into chunks aligned with HLS video segments for streaming delivery.
- Batch-process and write modified captions back to WebVTT format programmatically.
- Build a caption management tool that reads, edits, and exports captions in multiple formats.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads, writes, and segments WebVTT caption files; converts captions from SubRip and YouTube SBV formats.
Yes, if you need straightforward WebVTT reading, writing, or format conversion without active maintenance requirements. The permissive MIT license, zero dependencies, and broad Python version support make it low-risk. However, if your project demands ongoing feature development or active bug fixes, verify first whether a more actively maintained alternative exists.
Install
webvtt-py on PyPI
pip
pip install webvtt-pyuv
uv add webvtt-pypoetry
poetry add webvtt-pyInstalling webvtt-py
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 806 days ago, though the repository remains active with a recent commit on 2024-06-13. Suitable for stable, read-heavy caption workflows.
License in practice
MIT license is permissive and poses no restrictions on commercial or proprietary use. You can use, modify, and distribute this package freely with minimal legal overhead.
Quickstart
pip install webvtt-py
import webvtt
for caption in webvtt.read('captions.vtt'):
print(caption.start)
print(caption.end)
print(caption.text)
Verify before relying
- Whether caption segmentation for HLS is suitable for modern streaming workflows or if alternatives are preferred.
- Performance characteristics when processing large caption files or many segments.
- Completeness of WebVTT spec compliance beyond documented operations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 806 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,904,723/month — #3,441 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: webvtt_py-0.5.1-py3-none-any.whl
Keywords: webvtt, captions
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
m3u8Parses and generates m3u8 playlist files (HLS…
permissive · top 5,000 on PyPI
pysubs2pysubs2 loads, edits, and saves subtitle files…
permissive · top 15,000 on PyPI
pysrtpysrt parses, edits, and writes SubRip (.srt)…
copyleft · top 15,000 on PyPI
trakitParses track names and filenames to extract…
permissive · top 15,000 on PyPI
aeidonaeidon reads, writes, and manipulates…
copyleft · top 15,000 on PyPI
srtParse, modify, and compose SRT subtitle files…
permissive · top 15,000 on PyPI
sphinxcontrib-videoA Sphinx extension that embeds HTML5 videos…
permissive · top 15,000 on PyPI
pytubefixDownloads YouTube videos, playlists, and…
permissive · top 15,000 on PyPI
pytubepytube downloads YouTube videos and playlists…
permissive · top 5,000 on PyPI
sphinxcontrib-youtubeAdds Sphinx directives to embed YouTube, Vimeo,…
permissive · top 15,000 on PyPI