webvtt-py


Namewebvtt-py JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/glut23/webvtt-py
SummaryWebVTT reader, writer and segmenter
upload_time2024-05-30 13:40:17
maintainerNone
docs_urlNone
authorAlejandro Mendez
requires_python>=3.7
licenseMIT
keywords webvtt captions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            webvtt-py
=========

|pypi| |pyversions| |license| |coverage| |build-status| |docs-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.

.. _`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 output/path

License
-------

Licensed under the MIT License.

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

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/webvtt-py.svg
    :alt: Supported Python versions
    :target: https://pypi.python.org/pypi/webvtt-py

.. |license| image:: https://img.shields.io/pypi/l/webvtt-py.svg
    :alt: MIT License
    :target: https://opensource.org/licenses/MIT

.. |coverage| image:: https://codecov.io/gh/glut23/webvtt-py/graph/badge.svg?branch=master
    :target: https://codecov.io/gh/glut23/webvtt-py

.. |build-status| image:: https://github.com/glut23/webvtt-py/actions/workflows/ci.yml/badge.svg?branch=master
    :target: https://github.com/glut23/webvtt-py/actions/workflows/ci.yml

.. |docs-status| image:: https://readthedocs.org/projects/webvtt-py/badge/?version=latest
    :target: http://webvtt-py.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. |downloads| image:: https://static.pepy.tech/badge/webvtt-py
    :target: https://pepy.tech/project/webvtt-py
    :alt: Downloads


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/glut23/webvtt-py",
    "name": "webvtt-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "webvtt captions",
    "author": "Alejandro Mendez",
    "author_email": "amendez23@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5e/f6/7c9c964681fb148e0293e6860108d378e09ccab2218f9063fd3eb87f840a/webvtt-py-0.5.1.tar.gz",
    "platform": null,
    "description": "webvtt-py\n=========\n\n|pypi| |pyversions| |license| |coverage| |build-status| |docs-status| |downloads|\n\n``webvtt-py`` is a Python module for reading/writing WebVTT_ caption files. It also features caption segmentation useful when captioning `HLS videos`_.\n\nDocumentation is available at http://webvtt-py.readthedocs.io.\n\n.. _`WebVTT`: http://dev.w3.org/html5/webvtt/\n.. _`HLS videos`: https://tools.ietf.org/html/draft-pantos-http-live-streaming-19\n\nInstallation\n------------\n\n::\n\n    $ pip install webvtt-py\n\nUsage\n-----\n\n.. code-block:: python\n\n  import webvtt\n\n  for caption in webvtt.read('captions.vtt'):\n      print(caption.start)\n      print(caption.end)\n      print(caption.text)\n\nSegmenting for HLS\n------------------\n\n.. code-block:: python\n\n  import webvtt\n\n  webvtt.segment('captions.vtt', 'output/path')\n\nConverting captions from other formats\n--------------------------------------\n\nSupported formats:\n\n* SubRip (.srt)\n* YouTube SBV (.sbv)\n\n.. code-block:: python\n\n  import webvtt\n\n  webvtt = webvtt.from_srt('captions.srt')\n  webvtt.save()\n\n  # one liner if we just need to convert without editing\n  webvtt.from_sbv('captions.sbv').save()\n\nCLI\n---\nCaption segmentation is also available from the command line:\n\n::\n\n    $ webvtt segment captions.vtt --output output/path\n\nLicense\n-------\n\nLicensed under the MIT License.\n\n.. |pypi| image:: https://img.shields.io/pypi/v/webvtt-py.svg\n    :target: https://pypi.python.org/pypi/webvtt-py\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/webvtt-py.svg\n    :alt: Supported Python versions\n    :target: https://pypi.python.org/pypi/webvtt-py\n\n.. |license| image:: https://img.shields.io/pypi/l/webvtt-py.svg\n    :alt: MIT License\n    :target: https://opensource.org/licenses/MIT\n\n.. |coverage| image:: https://codecov.io/gh/glut23/webvtt-py/graph/badge.svg?branch=master\n    :target: https://codecov.io/gh/glut23/webvtt-py\n\n.. |build-status| image:: https://github.com/glut23/webvtt-py/actions/workflows/ci.yml/badge.svg?branch=master\n    :target: https://github.com/glut23/webvtt-py/actions/workflows/ci.yml\n\n.. |docs-status| image:: https://readthedocs.org/projects/webvtt-py/badge/?version=latest\n    :target: http://webvtt-py.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. |downloads| image:: https://static.pepy.tech/badge/webvtt-py\n    :target: https://pepy.tech/project/webvtt-py\n    :alt: Downloads\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "WebVTT reader, writer and segmenter",
    "version": "0.5.1",
    "project_urls": {
        "Homepage": "https://github.com/glut23/webvtt-py"
    },
    "split_keywords": [
        "webvtt",
        "captions"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f3edaad7e0f5a462d679f7b4d2e0d8502c3096740c883b5bbed5103146480937",
                "md5": "75c39989701173a500272e68ea3466f3",
                "sha256": "9d517d286cfe7fc7825e9d4e2079647ce32f5678eb58e39ef544ffbb932610b7"
            },
            "downloads": -1,
            "filename": "webvtt_py-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75c39989701173a500272e68ea3466f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 19802,
            "upload_time": "2024-05-30T13:40:14",
            "upload_time_iso_8601": "2024-05-30T13:40:14.661091Z",
            "url": "https://files.pythonhosted.org/packages/f3/ed/aad7e0f5a462d679f7b4d2e0d8502c3096740c883b5bbed5103146480937/webvtt_py-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ef67c9c964681fb148e0293e6860108d378e09ccab2218f9063fd3eb87f840a",
                "md5": "e667a20cc493849bcf59b78a9385d553",
                "sha256": "2040dd325277ddadc1e0c6cc66cbc4a1d9b6b49b24c57a0c3364374c3e8a3dc1"
            },
            "downloads": -1,
            "filename": "webvtt-py-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e667a20cc493849bcf59b78a9385d553",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 55128,
            "upload_time": "2024-05-30T13:40:17",
            "upload_time_iso_8601": "2024-05-30T13:40:17.189729Z",
            "url": "https://files.pythonhosted.org/packages/5e/f6/7c9c964681fb148e0293e6860108d378e09ccab2218f9063fd3eb87f840a/webvtt-py-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-30 13:40:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "glut23",
    "github_project": "webvtt-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "webvtt-py"
}
        
Elapsed time: 0.41352s