Skip to main content

Local audio and YouTube transcription CLI

Project description

ytxt

Local-first, privacy-focused transcription CLI.

ytxt is a developer-centric tool for transcribing audio from YouTube, web URLs, or local files. It bridges the gap between yt-dlp and faster-whisper, providing a seamless, automated pipeline that runs entirely on your machine.

PyPI version License: MIT

Why ytxt?

  • Zero-Cloud Privacy: No data leaves your machine. Perfect for sensitive meetings or private research.
  • High Performance: Powered by faster-whisper (CTranslate2), which is up to 4x faster than OpenAI's original implementation.
  • Battery Included: Handles downloading, audio extraction (ffmpeg), and transcription in one command.
  • Smart Caching: Avoid redundant computations. ytxt hashes inputs to skip re-transcribing files you've already processed.
  • Universal: Supports 1,000+ sites via yt-dlp.

Installation

Requires ffmpeg installed on your system.

# Using pip
pip install ytxt

# Using uv (recommended for speed)
uv tool install ytxt

Quick Start (CLI)

Transcribe any YouTube video to Markdown with timestamps:

ytxt "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --format markdown --timestamps --output transcript.md

Power User Tricks

Pipe to an LLM for summarization:

ytxt <url> | llm "Summarize this transcript for a technical audience"

Extract metadata with jq:

ytxt <url> --format json | jq '.[].text'

Data Pipelines & Automation

ytxt is designed to be a "high-signal" component in your data infrastructure. Because status logs are routed to stderr, the stdout remains clean for programmatic use.

  • RAG Pipelines: Use ytxt as an ingestion layer to feed YouTube transcripts directly into vector databases like Pinecone or Chroma.
  • AI Agents: Pipe transcripts directly into LLMs for summarization, sentiment analysis, or entity extraction.
  • Subtitles: Generate industry-standard .srt files for video editing workflows.
  • Scheduled Jobs: Run ytxt in a cron job or GitHub Action to monitor and transcribe new videos from a playlist.

Library Usage

ytxt is designed to be imported into your own Python automation scripts.

from ytxt import download_audio, transcribe_audio

# 1. Download & Extract
audio_path = download_audio("https://youtube.com/...")

# 2. Transcribe Locally
transcript = transcribe_audio(audio_path, model_size="medium")

# 3. Use the result (list of dicts with 'start', 'end', 'text')
for segment in transcript:
    print(f"[{segment['start']}] {segment['text']}")

Configuration

Option Description Default
--model Whisper model size (tiny, base, small, medium, large-v3) base
--format Output format (text, markdown, srt, json) text
--timestamps Include timestamps in text/markdown output False
--no-cache Force re-transcription by ignoring cache False

Development

git clone https://github.com/rayanrane/ytxt.git
cd ytxt
pip install -e .

License

MIT

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

ytxt-0.2.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

ytxt-0.2.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ytxt-0.2.3.tar.gz.

File metadata

  • Download URL: ytxt-0.2.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ytxt-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a4712ad1a3ac23c7fcc65f3ac5a5f5fc08495ca78536ccc4d71444ca76675c97
MD5 1511c54d6006c6d6766286e83cb3e986
BLAKE2b-256 52be5b960670c37847cc01275a46f9f769572800b5f3bc15f4a26ff4f948b796

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytxt-0.2.3.tar.gz:

Publisher: publish.yml on RayanR000/ytxt

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

File details

Details for the file ytxt-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: ytxt-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ytxt-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9d0f16da97a9f98a05d2949b6c2dce579e118d9715dfca868ef44c695104de42
MD5 3c10594f1f62315e4491cbac9e5040b3
BLAKE2b-256 a15688ae677683e95392e8d856557e1bc00fec4e0d7b1acab002e1e9b33bd2ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytxt-0.2.3-py3-none-any.whl:

Publisher: publish.yml on RayanR000/ytxt

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