Skip to main content

subverter

Subtitle and transcript readers into one model: SubRip, WebVTT, LRC, CSV and TSV, and whisper-cli's and WhisperX's JSON.

A file read becomes what it holds: its cues, the word timings where the format keeps them, notes on what it held that the model does not, and a refusal -- with its reason -- for what cannot be read.

Format Read as
SubRip cues; WhisperX's highlighted cues read back into words
WebVTT cues, as SubRip's
LRC a line's time, its text
CSV/TSV start, end, text (milliseconds), columns by header, as whisper-cli and WhisperX write them
JSON whisper-cli's and WhisperX's: chunks and word timings

Installing

pip install subverter

Python 3.13 or later; the standard library alone.

Using it

>>> import subverter
>>> reading = subverter.read("srt", b"1\n00:00:01,000 --> 00:00:02,500\nHello <i>there</i>\n", "talk.srt")
>>> reading.cues
(Cue(start=1000, end=2500, text='Hello <i>there</i>', segment=''),)
>>> subverter.untagged(reading.cues[0].text)
'Hello there'
>>> subverter.read("json", b"[1, 2]", "talk.json")
Traceback (most recent call last):
  ...
subverter.Error: not a whisper-cli (.transcription) or WhisperX (.segments) JSON transcript: talk.json

Times are milliseconds. A text that cannot be read is refused: subverter.Error, its message the reason.

Licence

Part of ffsuite, beside ffman: its own package. Licensed under either of MIT or Apache-2.0, at your option.

Metadata

Release files for subverter 0.1.0

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

Source distribution (sdist)

Source distribution for subverter 0.1.0
File Size Uploaded
subverter-0.1.0.tar.gz 20.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for subverter 0.1.0
File Interpreter ABI Platform
subverter-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.3 kB

Release files / subverter-0.1.0.tar.gz

Download URL subverter-0.1.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3bdb6ab344781e7f58fb5f1fab76eb6d8766283b334d1a50be61eca9daece93b
BLAKE2b-256 checksum
How to use checksums
5ddc3d9726aebeb48f8b794986149bd86d4c1918d021214686168692d81ddcac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / subverter-0.1.0-py3-none-any.whl

Download URL subverter-0.1.0-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f920842e4c561676a6b34bca3630eb466fa5c44f2d15ef4d77d038c26d4cdae8
BLAKE2b-256 checksum
How to use checksums
8cfd5fb9b12bddf30376b737c58c3a0b1bd3965c75a226a84b2106ec8148c60f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

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