subtitle-parser
===============
This is a simple Python library for parsing subtitle files in SRT or WebVTT format.
How to use stand-alone?
-----------------------
You can use this as a script to convert subtitles to HTML or CSV.
If you have installed it using `pip install subtitle-parser`, use `python3 -m subtitle_parser`. If you have cloned this repository or downloaded the file, use `python3 subtitle_parser.py`.
Examples:
```
$ python3 subtitle_parser.py --to csv Zoom_transcript.vtt --output transcript.csv
```
```
$ python3 -m subtitle_parser --to html episode.srt --input-charset iso-8859-15 --output dialogue.html
```
How to use as a library?
------------------------
```python
import subtitle_parser
with open('some_file.srt', 'r') as input_file:
parser = subtitle_parser.SrtParser(input_file)
parser.parse()
parser.print_warnings()
for subtitle in parser.subtitles:
print(subtitle.text)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/remram44/subtitle-parser",
"name": "subtitle-parser",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4",
"maintainer_email": "",
"keywords": "subtitle,srt,webvtt,video,text track,subrip",
"author": "Remi Rampin",
"author_email": "remi@rampin.org",
"download_url": "https://files.pythonhosted.org/packages/9d/c9/d80ebe909b0f55b4d66c7df8af40bfb89ee9c7ccd9e07145070c69a1649d/subtitle-parser-1.2.0.tar.gz",
"platform": null,
"description": "subtitle-parser\n===============\n\nThis is a simple Python library for parsing subtitle files in SRT or WebVTT format.\n\nHow to use stand-alone?\n-----------------------\n\nYou can use this as a script to convert subtitles to HTML or CSV.\n\nIf you have installed it using `pip install subtitle-parser`, use `python3 -m subtitle_parser`. If you have cloned this repository or downloaded the file, use `python3 subtitle_parser.py`.\n\nExamples:\n\n```\n$ python3 subtitle_parser.py --to csv Zoom_transcript.vtt --output transcript.csv\n```\n\n```\n$ python3 -m subtitle_parser --to html episode.srt --input-charset iso-8859-15 --output dialogue.html\n```\n\nHow to use as a library?\n------------------------\n\n```python\nimport subtitle_parser\n\nwith open('some_file.srt', 'r') as input_file:\n parser = subtitle_parser.SrtParser(input_file)\n parser.parse()\n\nparser.print_warnings()\n\nfor subtitle in parser.subtitles:\n print(subtitle.text)\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Parser for SRT and WebVTT subtitle files",
"version": "1.2.0",
"split_keywords": [
"subtitle",
"srt",
"webvtt",
"video",
"text track",
"subrip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f0b8729a5ad61bf04e214ec7ccc20152705a0a151fb23803eb9105c1a361211b",
"md5": "c3b0d500e42637cb5725d92469eacf3f",
"sha256": "9293d0ae5f24f41249a39e23162f42f036bfd99543c506b4f3e9790a702a87a0"
},
"downloads": -1,
"filename": "subtitle_parser-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c3b0d500e42637cb5725d92469eacf3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4",
"size": 6097,
"upload_time": "2023-01-11T15:35:58",
"upload_time_iso_8601": "2023-01-11T15:35:58.603269Z",
"url": "https://files.pythonhosted.org/packages/f0/b8/729a5ad61bf04e214ec7ccc20152705a0a151fb23803eb9105c1a361211b/subtitle_parser-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9dc9d80ebe909b0f55b4d66c7df8af40bfb89ee9c7ccd9e07145070c69a1649d",
"md5": "a2ed0518715c0edefbc4958429ba0da0",
"sha256": "11a45333c0fffb981912185142ac655f5511cb88bbcd578f65111f4be3add5af"
},
"downloads": -1,
"filename": "subtitle-parser-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "a2ed0518715c0edefbc4958429ba0da0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4",
"size": 5817,
"upload_time": "2023-01-11T15:35:41",
"upload_time_iso_8601": "2023-01-11T15:35:41.859228Z",
"url": "https://files.pythonhosted.org/packages/9d/c9/d80ebe909b0f55b4d66c7df8af40bfb89ee9c7ccd9e07145070c69a1649d/subtitle-parser-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-11 15:35:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "remram44",
"github_project": "subtitle-parser",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "subtitle-parser"
}