wp

webvtt-py

Read, write and segment WebVTT caption files in Python.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

89

Maintenance

Last Commit

1yr ago

Contributors

9

Package

Dependencies

1

License

MIT

Categories

Readme

webvtt-py

.. image:: https://img.shields.io/pypi/v/webvtt-py.svg :target: https://pypi.python.org/pypi/webvtt-py

.. image:: https://travis-ci.org/glut23/webvtt-py.svg?branch=master :target: https://travis-ci.org/glut23/webvtt-py

.. image:: https://readthedocs.org/projects/webvtt-py/badge/?version=latest :target: http://webvtt-py.readthedocs.io/en/latest/?badge=latest :alt: 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 http://webvtt-py.readthedocs.io.

.. WebVTT: http://dev.w3.org/html5/webvtt/ .. HLS videos: https://tools.ietf.org/html/draft-pantos-http-live-streaming-19

Installation

::

$ pip install webvtt-py

Usage

.. code-block:: python

import webvtt

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

Segmenting for HLS

.. code-block:: python

import webvtt

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

Converting captions from other formats

Supported formats:

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

.. code-block:: python

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 destination/directoy

License

Licensed under the MIT License.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial