Skip to main content

WebVTT reader, writer and segmenter

Project description Documentation Status

webvtt-py is a Python module for reading/writing WebVTT caption files. It also features caption segmentation useful when captioning HLS videos.

Requires Python 3.4+.

Documentation is available at


$ pip install webvtt-py


import webvtt

for caption in'captions.vtt'):

Segmenting for HLS

import webvtt

webvtt.segment('captions.vtt', 'output/path')

Converting captions from other formats

Supported formats:

  • SubRip (.srt)
  • YouTube SBV (.sbv)
import webvtt

webvtt = webvtt.from_srt('')

# one liner if we just need to convert without editing


Caption segmentation is also available from the command line:

$ webvtt segment captions.vtt --output destination/directoy


Licensed under the MIT License.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for webvtt-py, version 0.4.6
Filename, size File type Python version Upload date Hashes
Filename, size webvtt_py-0.4.6-py3-none-any.whl (17.0 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page