Skip to main content

WebVTT reader, writer and segmenter

Project description

https://img.shields.io/pypi/v/webvtt-py.svg https://travis-ci.org/glut23/webvtt-py.svg?branch=master 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.3+.

Documentation is available at http://webvtt-py.readthedocs.io.

Installation

$ pip install webvtt-py

Usage

from webvtt import WebVTT

webvtt = WebVTT().read('captions.vtt')
for c in webvtt.captions:
    print(c.start)
    print(c.end)
    print(c.text)

Segmenting for HLS

from webvtt import WebVTTSegmenter

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

Converting SRT captions

from webvtt import WebVTT

webvtt = WebVTT().from_srt('captions.srt')
webvtt.save()

License

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.

Source Distribution

webvtt-py-0.2.0.zip (10.4 kB view hashes)

Uploaded source

Built Distribution

webvtt_py-0.2.0-py3-none-any.whl (8.4 kB view hashes)

Uploaded py3

Supported by

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