Skip to main content

pypi Supported Python versions MIT License coverage build-status Documentation Status Downloads

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

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

Installation

$ pip install webvtt-py

Usage

import webvtt

for caption in webvtt.read('captions.vtt'):
    print(caption.start)
    print(caption.end)
    print(caption.text)

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('captions.srt')
webvtt.save()

# one liner if we just need to convert without editing
webvtt.from_sbv('captions.sbv').save()

CLI

Caption segmentation is also available from the command line:

$ webvtt segment captions.vtt --output output/path

License

Licensed under the MIT License.

Release files for webvtt-py 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webvtt-py 0.5.1
File Size Uploaded
webvtt-py-0.5.1.tar.gz 55.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webvtt-py 0.5.1
File Interpreter ABI Platform
webvtt_py-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 74.9 kB

Release files / webvtt-py-0.5.1.tar.gz

Download URL webvtt-py-0.5.1.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2040dd325277ddadc1e0c6cc66cbc4a1d9b6b49b24c57a0c3364374c3e8a3dc1
BLAKE2b-256 checksum
How to use checksums
5ef67c9c964681fb148e0293e6860108d378e09ccab2218f9063fd3eb87f840a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.6

Release files / webvtt_py-0.5.1-py3-none-any.whl

Download URL webvtt_py-0.5.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d517d286cfe7fc7825e9d4e2079647ce32f5678eb58e39ef544ffbb932610b7
BLAKE2b-256 checksum
How to use checksums
f3edaad7e0f5a462d679f7b4d2e0d8502c3096740c883b5bbed5103146480937
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.6

1 release file

0.4.5

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

2 release files

0.2.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page