Skip to main content

CLI tool to transcribe audio from YouTube videos to text for IELTS listening practice

Project description

Audio Text

CLI tool to transcribe YouTube videos to text, designed for IELTS listening practice.

Features

  • Transcribe YouTube videos to text with timestamps
  • Uses OpenAI Whisper for accurate speech-to-text
  • Automatic audio chunking for long videos (up to 30 minutes)
  • Interactive menu or direct CLI commands
  • Export transcripts to TXT or JSON
  • Local caching to avoid re-processing

Installation

Using Homebrew (macOS)

brew tap anhtt2211/tap
brew install audio-text-cli

Using pip

pip install audio-text-cli

Prerequisites

  • Python 3.10+
  • ffmpeg (required for audio processing)
# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg

Usage

Interactive Mode

Simply run without arguments to get an interactive menu:

audio-text
╭──────────────────────────────────────────────────────────────────────────────╮
│  ╔═╗┬ ┬┌┬┐┬┌─┐  ╔╦╗┌─┐─┐ ┬┌┬┐                                                │
│  ╠═╣│ │ ││││ │   ║ ├┤ ┌┴┬┘ │                                                 │
│  ╩ ╩└─┘─┴┘┴└─┘   ╩ └─┘┴ └─ ┴                                                 │
│                                                                              │
│ YouTube Video Transcription for IELTS Practice                               │
╰──────────────────────────────────────────────────────────────────────────────╯

  [1]    Transcribe a YouTube video
  [2]    List saved transcripts
  [3]    View a transcript
  [4]    Export transcript to file
  [5]    Delete a transcript
  [q]    Quit

Direct Commands

# Transcribe a video
audio-text transcribe https://youtube.com/watch?v=VIDEO_ID

# Transcribe with custom output directory
audio-text transcribe https://youtu.be/VIDEO_ID --output ./my-transcripts

# List saved transcripts
audio-text list

# View a transcript
audio-text view VIDEO_ID

# Export transcript (auto-generates filename from title)
audio-text export VIDEO_ID

# Export with custom filename
audio-text export VIDEO_ID ./output.txt --format txt

# Delete a transcript
audio-text delete VIDEO_ID

Output Example

╭────────────────────────────── Transcript Info ───────────────────────────────╮
│    Title: Example Video Title                                                │
│      URL: https://www.youtube.com/watch?v=VIDEO_ID                           │
│ Duration: 5m 30s                                                             │
│ Segments: 45                                                                 │
│    Model: small                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

[00:00 -> 00:05] Hello and welcome to this video.
[00:05 -> 00:12] Today we're going to discuss...

Configuration

Transcripts are saved to ~/.audio-text/transcripts/ by default.

Use --output or -o to specify a custom directory.

Limitations

  • Maximum video duration: 30 minutes
  • English language only
  • YouTube videos only (for now)

Development

# Clone the repository
git clone https://github.com/anhtt2211/audio-text.git
cd audio-text

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
ruff check src/

License

MIT License - see LICENSE for details.

Author

Anh Tran (@anhtt2211)

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

audio_text_cli-0.1.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

audio_text_cli-0.1.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file audio_text_cli-0.1.0.tar.gz.

File metadata

  • Download URL: audio_text_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for audio_text_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3427c4e58b4722047a2a4c4ad18acfcd9b8e38ca9a3e2dc726e518ee890563b2
MD5 71c6c295117680485957a3c2bb3c8729
BLAKE2b-256 3a15f1791039383d598598d9d58480e20f2ba69bdf8c4c296278ad5e2205e280

See more details on using hashes here.

File details

Details for the file audio_text_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: audio_text_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for audio_text_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fdffb1b7c9a9b03b1544ed3b58d77c9fecaffcc4b4901e3adefae45bb929ac1
MD5 879903cd67ac811c521af0561494419c
BLAKE2b-256 0921b3ea52d005740cd5dc45b7a9a50968269a62b7ebdad8b01abc0a71c702cc

See more details on using hashes here.

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