WebVTT reader, writer and segmenter
Project description
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
for caption in WebVTT().read('captions.vtt'):
print(caption.start)
print(caption.end)
print(caption.text)
Segmenting for HLS
from webvtt import WebVTTSegmenter
WebVTTSegmenter().segment('captions.vtt', 'output/path')
Converting captions from other formats
Supported formats:
SubRip (.srt)
YouTube SBV (.sbv)
from webvtt import WebVTT
webvtt = WebVTT().from_srt('captions.srt')
webvtt.save()
# we can convert captions in one line
WebVTT().from_sbv('captions.sbv').save()
CLI
Caption segmentation is also available from the command line:
$ webvtt segment captions.vtt --output destination/directoy
License
Licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webvtt_py-0.3.3-py3-none-any.whl.
File metadata
- Download URL: webvtt_py-0.3.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
017013b2b9d9b0b2ba64a9e2244179fd69b0bb3c835564b1a1b7427f95d7aa4e
|
|
| MD5 |
89bfe6cecf8d78b20e9199d95359b2c0
|
|
| BLAKE2b-256 |
6a9fb9d6321b5ce78a358d6bd48f8e2d176a1945c85a368013ad214ec4e0457f
|