subtitle-parser


Namesubtitle-parser JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/remram44/subtitle-parser
SummaryParser for SRT and WebVTT subtitle files
upload_time2024-09-15 21:12:04
maintainerNone
docs_urlNone
authorRemi Rampin
requires_python<4,>=3.7
licenseMIT
keywords subtitle srt webvtt video text track subrip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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": null,
    "docs_url": null,
    "requires_python": "<4,>=3.7",
    "maintainer_email": null,
    "keywords": "subtitle, srt, webvtt, video, text track, subrip",
    "author": "Remi Rampin",
    "author_email": "remi@rampin.org",
    "download_url": "https://files.pythonhosted.org/packages/6b/4c/14a7c8a089c43823562035dd6a3bd5ea633b133d6e230289fe30d10a17b0/subtitle_parser-2.0.1.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": "2.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/remram44/subtitle-parser/issues",
        "Homepage": "https://github.com/remram44/subtitle-parser",
        "Repository": "https://github.com/remram44/subtitle-parser"
    },
    "split_keywords": [
        "subtitle",
        " srt",
        " webvtt",
        " video",
        " text track",
        " subrip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "650f89de0a2df2d313bf9d8a7598b5a82ba76be23670cf57b8ee813b1516629c",
                "md5": "68a06a4c13f1fb27500379855cf555b7",
                "sha256": "7d903d6f7974ab41849491940e60e284c50c3df7f4d81cd007101e25783ea635"
            },
            "downloads": -1,
            "filename": "subtitle_parser-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "68a06a4c13f1fb27500379855cf555b7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.7",
            "size": 5883,
            "upload_time": "2024-09-15T21:12:07",
            "upload_time_iso_8601": "2024-09-15T21:12:07.447693Z",
            "url": "https://files.pythonhosted.org/packages/65/0f/89de0a2df2d313bf9d8a7598b5a82ba76be23670cf57b8ee813b1516629c/subtitle_parser-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b4c14a7c8a089c43823562035dd6a3bd5ea633b133d6e230289fe30d10a17b0",
                "md5": "7e89e7903b21a87f07fec949bfdd6f58",
                "sha256": "1215907586c6ffbdbdefd59c0ee4f35026a6dad6cf87908f3f4a70b1bb59e353"
            },
            "downloads": -1,
            "filename": "subtitle_parser-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7e89e7903b21a87f07fec949bfdd6f58",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 8431,
            "upload_time": "2024-09-15T21:12:04",
            "upload_time_iso_8601": "2024-09-15T21:12:04.395978Z",
            "url": "https://files.pythonhosted.org/packages/6b/4c/14a7c8a089c43823562035dd6a3bd5ea633b133d6e230289fe30d10a17b0/subtitle_parser-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-15 21:12:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "remram44",
    "github_project": "subtitle-parser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "subtitle-parser"
}
        
Elapsed time: 1.41430s