undertext
library to load, edit and save different formats of subtitles
Installation
pip3 install undertext
File Formats
| ext | name | read | write | Flags |
|---|---|---|---|---|
.ass |
Advanced SubStation Alpha | ❌ | ❌ | TT |
.sbv |
SubViewer | ✅ | ✅ | TT |
.srt |
SubRip | ✅ | ✅ | TT |
.ssa |
Sub Station Alpha | ❌ | ❌ | TT |
.sub |
MicroDVD | ✅ | ✅ | TF |
.vtt |
WebVTT | ✅ | ✅ | TT |
*Listed formats that are currently unsupported may be added at a later version
Flag Information:
T. = Text Based
B. = Bitmap Based
.T = Time-Based
.F = Frame-Based
Examples
import undertext
captions = undertext.load("example.en.srt")
undertext.dump(captions, "example.en.vtt")
import undertext
captions = [
undertext.Caption(start=0, end=10, text="Hello"),
undertext.Caption(start=10, end=20, text="World"),
]
undertext.dump(captions, "out.srt")
CLI
$ cat example.vtt
WEBVTT
00:00:00.000 --> 00:00:01.000
hello world 0
00:00:02.000 --> 00:00:03.000
hello world 2
00:00:04.000 --> 00:00:05.000
hello world 4
00:00:06.000 --> 00:00:07.000
hello world 6
00:00:08.000 --> 00:00:09.000
hello world 8
$ undertext read example.vtt
<00:00:00.000 -> 00:00:01.000> 'hello world 0'
<00:00:02.000 -> 00:00:03.000> 'hello world 2'
<00:00:04.000 -> 00:00:05.000> 'hello world 4'
<00:00:06.000 -> 00:00:07.000> 'hello world 6'
<00:00:08.000 -> 00:00:09.000> 'hello world 8'
$ undertext convert example.vtt output.srt
$ cat output.srt
1
00:00:00,000 --> 00:00:01,000
hello world 0
2
00:00:02,000 --> 00:00:03,000
hello world 2
3
00:00:04,000 --> 00:00:05,000
hello world 4
4
00:00:06,000 --> 00:00:07,000
hello world 6
5
00:00:08,000 --> 00:00:09,000
hello world 8
Metadata
Release files for undertext 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| undertext-0.4.1.tar.gz | 11.4 kB | Without provenance | Details for undertext-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| undertext-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for undertext-0.4.1-py3-none-any.whl |
Total release size: 27.4 kB
Release files / undertext-0.4.1.tar.gz
| Download URL | undertext-0.4.1.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f1a4517301ba2c29f51079662613e4cca979864cc250a74be93001e035a09cb
|
|
BLAKE2b-256 checksum How to use checksums |
b6e40bab61557973a695634d048f86fcf74ed294b8c691c812f0e1f838533795
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Release files / undertext-0.4.1-py3-none-any.whl
| Download URL | undertext-0.4.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0868aaf32a55ed243b7f8df91dbcb7f9dbdaad07649402fb768096d4fd106357
|
|
BLAKE2b-256 checksum How to use checksums |
c21970375bc1efb323c878054c6dd99a9ee41cce322eb2ec48ab7a5b1281f716
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Security for undertext 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.