Skip to main content

Convert podcast transcripts from HTML, SRT, WebVtt, Podlove etc into PodcastIndex JSON.

Project description

podcast-transcript-convert

PyPI Lint and Test Ruff Code style: black Types: ty + pyrefly Python 3.13+ twitter

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

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

podcast_transcript_convert-0.2.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

podcast_transcript_convert-0.2.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file podcast_transcript_convert-0.2.0.tar.gz.

File metadata

File hashes

Hashes for podcast_transcript_convert-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c9b4314c75fde112ab14c0fd4c8eb83ebb4813e22962b6fbe88cee42377086c
MD5 4162e79d885cf953f3bd25efd9f209fc
BLAKE2b-256 070d88cf87699c81d153042dca036fce7fa0933774f29c33b874b94edf276ab5

See more details on using hashes here.

Provenance

The following attestation bundles were made for podcast_transcript_convert-0.2.0.tar.gz:

Publisher: publish.yml on hbmartin/podcast-transcript-convert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file podcast_transcript_convert-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for podcast_transcript_convert-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbaf4cf7e955f3ebd8a8e5e83fb3ca008e23de9d1d950418d85e9ec3f8d11725
MD5 8125f4545f15b6f7d006dfe5b27d35ea
BLAKE2b-256 719f73b239dbe12633d0e465c75703d059558b25edb8ef2eeecf8bb27182e813

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page