Skip to main content

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?

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)

Release files for subtitle-parser 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subtitle-parser 2.0.1
File Size Uploaded
subtitle_parser-2.0.1.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for subtitle-parser 2.0.1
File Interpreter ABI Platform
subtitle_parser-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / subtitle_parser-2.0.1.tar.gz

Download URL subtitle_parser-2.0.1.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1215907586c6ffbdbdefd59c0ee4f35026a6dad6cf87908f3f4a70b1bb59e353
BLAKE2b-256 checksum
How to use checksums
6b4c14a7c8a089c43823562035dd6a3bd5ea633b133d6e230289fe30d10a17b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / subtitle_parser-2.0.1-py3-none-any.whl

Download URL subtitle_parser-2.0.1-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d903d6f7974ab41849491940e60e284c50c3df7f4d81cd007101e25783ea635
BLAKE2b-256 checksum
How to use checksums
650f89de0a2df2d313bf9d8a7598b5a82ba76be23670cf57b8ee813b1516629c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page