https://github.com/abhishekkr/pywebvtt
Python file parser for WebVTT subtitles
https://github.com/abhishekkr/pywebvtt
file-parser parser python python3 subtitles webvtt
Last synced: 5 months ago
JSON representation
Python file parser for WebVTT subtitles
- Host: GitHub
- URL: https://github.com/abhishekkr/pywebvtt
- Owner: abhishekkr
- Created: 2023-06-20T22:50:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-24T18:42:09.000Z (almost 3 years ago)
- Last Synced: 2025-01-12T13:15:34.408Z (over 1 year ago)
- Topics: file-parser, parser, python, python3, subtitles, webvtt
- Language: Python
- Homepage: https://pypi.org/project/pywebvtt/
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## pywebvtt
> to parse WebVTT subtitle file into a traversable data structure
>
> [pypi/pywebvtt](https://pypi.org/project/pywebvtt/)
* to run tests `poetry install && poetry run pytest`
* to run example `poetry install && poetry run python examples/parse-sample.py`
* sample usage `pip install pywebvtt` and
```
import pywebvtt
scenes = pywebvtt.ParseFile('sample.vtt')
for s in scenes:
# every scene has: s.start, s.end, s.start_millisec, s.end_millisec, s.transcript
print(s.string())
```
---
### ToDo
> [source: VTT Mozilla doc](https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API)
* add support for multi-line NOTE
* add support for Style & Cue blocks
---