Convert podcast transcripts from HTML, SRT, WebVtt, Podlove etc into PodcastIndex JSON.
Project description
podcast-transcript-convert
Convert podcast transcripts from HTML, SRT, WebVtt, Podlove etc into PodcastIndex JSON.
Requires Python 3.13 or later.
Installation
It is recommended to use pipx or uv to install and run the CLI tool. If you wish to use the library, you can install with pip instead.
brew install pipx
pipx install podcast-transcript-convert
# or: uv tool install podcast-transcript-convert
If you've already installed the package and wish to upgrade:
pipx upgrade podcast-transcript-convert
Usage
Run the conversion app on your transcripts directory.
transcript2json transcripts/ converted/
You can then inspect the output JSON files in the converted/ directory. The directory structure of transcripts/ is mirrored in converted/ so that files with the same name do not collide.
You can also convert a single file:
transcript2json "episode.srt" converted/
# or specify the output file name
transcript2json "episode.srt" episode.json
Or read transcript paths and episode metadata from an overcast-to-sqlite database (episode and feed metadata is embedded in the output JSON):
transcript2json overcast.db converted/
Options
| Flag | Description |
|---|---|
--ignore-file PATH |
File with one filename per line to skip. Defaults to .transcriptignore in the working directory, if present. |
--overwrite |
Re-convert files whose destination JSON already exists (they are skipped by default). |
--dry-run |
Report what would be converted without writing any files. |
--quiet |
Only log warnings and errors. |
--version |
Print the version and exit. |
Files that fail to convert are logged and skipped — a single malformed transcript will not abort a bulk run. The exit code is 0 on success and 1 when nothing could be converted.
Library Usage
from podcast_transcript_convert.convert import bulk_convert
summary = bulk_convert("transcripts_dir/", "converted_dir/")
print(f"{len(summary.converted)} converted, {len(summary.failed)} failed")
bulk_convert accepts optional ignore (list of filenames to skip), overwrite, and dry_run arguments and returns a ConversionSummary with converted, skipped, failed, and unknown file lists.
To convert a single file of any supported type:
from podcast_transcript_convert.convert import convert_file
convert_file("episode.srt", "episode.json")
Individual file type converters are in the converters package. You can use them directly if you know the file type.
You can use file_typing.identify_file_type(file) to determine the file type of a transcript file, or file_typing.identify_file_types(files) to group a collection of paths by detected type.
Development
Pull requests are very welcome! For major changes, please open an issue first to discuss what you would like to change.
This project uses uv for dependency management, building, and publishing.
git clone git@github.com:hbmartin/podcast-transcript-convert.git
cd podcast-transcript-convert
uv sync
uv run pytest
# Replace with the actual path to your transcript files
uv run transcript2json ~/Downloads/overcast-to-sqlite/archive/transcripts converted/
Code Quality
This project is linted with ruff, uses Black code formatting, and is type checked with ty and pyrefly.
uv run ruff check .
uv run ty check podcast_transcript_convert
uv run pyrefly check
Authors
- Harold Martin - harold.martin at gmail
- Icon courtesy of Vecteezy.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file podcast_transcript_convert-0.2.0.tar.gz.
File metadata
- Download URL: podcast_transcript_convert-0.2.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c9b4314c75fde112ab14c0fd4c8eb83ebb4813e22962b6fbe88cee42377086c
|
|
| MD5 |
4162e79d885cf953f3bd25efd9f209fc
|
|
| BLAKE2b-256 |
070d88cf87699c81d153042dca036fce7fa0933774f29c33b874b94edf276ab5
|
Provenance
The following attestation bundles were made for podcast_transcript_convert-0.2.0.tar.gz:
Publisher:
publish.yml on hbmartin/podcast-transcript-convert
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
podcast_transcript_convert-0.2.0.tar.gz -
Subject digest:
3c9b4314c75fde112ab14c0fd4c8eb83ebb4813e22962b6fbe88cee42377086c - Sigstore transparency entry: 2103811448
- Sigstore integration time:
-
Permalink:
hbmartin/podcast-transcript-convert@86da1dc9466bf5974fd77a847531fd208f5057c2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/hbmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@86da1dc9466bf5974fd77a847531fd208f5057c2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file podcast_transcript_convert-0.2.0-py3-none-any.whl.
File metadata
- Download URL: podcast_transcript_convert-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbaf4cf7e955f3ebd8a8e5e83fb3ca008e23de9d1d950418d85e9ec3f8d11725
|
|
| MD5 |
8125f4545f15b6f7d006dfe5b27d35ea
|
|
| BLAKE2b-256 |
719f73b239dbe12633d0e465c75703d059558b25edb8ef2eeecf8bb27182e813
|
Provenance
The following attestation bundles were made for podcast_transcript_convert-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on hbmartin/podcast-transcript-convert
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
podcast_transcript_convert-0.2.0-py3-none-any.whl -
Subject digest:
bbaf4cf7e955f3ebd8a8e5e83fb3ca008e23de9d1d950418d85e9ec3f8d11725 - Sigstore transparency entry: 2103811531
- Sigstore integration time:
-
Permalink:
hbmartin/podcast-transcript-convert@86da1dc9466bf5974fd77a847531fd208f5057c2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/hbmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@86da1dc9466bf5974fd77a847531fd208f5057c2 -
Trigger Event:
release
-
Statement type: