skillfed

webvtt-py

WebVTT reader, writer and segmenter

webvtt-py v0.5.1 1.9M downloads/30d#3,441 on PyPI234
Permissive license MIT DORMANT released

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-py

uv

uv add webvtt-py

poetry

poetry add webvtt-py

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

webvtt caption parserread write vtt filessubtitle format conversionhls video caption segmentationsrt to webvtt convertercaption file processing
caption-subtitlesformat-conversionhls-streaming

More Python Modules packages