Skip to main content

CLI tools for YouTube transcripts, chapters, and annotated talks

Project description

hamel_tools

CLI tools that wrap the hamel Python library for working with YouTube videos and generating content.

Installation

# Install in development mode
pip install -e .

# Or using the Makefile
make install-dev

This installs three CLI commands:

  • ai-transcribe - Download YouTube transcripts
  • ai-chapters - Generate YouTube chapter summaries
  • ai-annotate-talk - Create annotated blog posts from technical talks

Usage

Transcript Tool

# Download transcript with timestamps
ai-transcribe "https://youtu.be/VIDEO_ID"

# Use seconds-only timestamps
ai-transcribe "https://youtu.be/VIDEO_ID" --seconds

# Save to file
ai-transcribe "https://youtu.be/VIDEO_ID" > transcript.txt

Chapter Generator

# Generate chapters (requires GEMINI_API_KEY)
export GEMINI_API_KEY="your-api-key"
ai-chapters "https://youtu.be/VIDEO_ID"

Annotated Talk Generator

# Generate annotated blog post (requires both API keys)
export GEMINI_API_KEY="your-api-key"
export JINA_READER_KEY="your-api-key"

# Basic usage
ai-annotate-talk "https://youtu.be/VIDEO_ID" slides.pdf output_images/

# With custom transcript
ai-annotate-talk "https://youtu.be/VIDEO_ID" slides.pdf output_images/ --transcript transcript.txt

# Save to file
ai-annotate-talk "https://youtu.be/VIDEO_ID" slides.pdf output_images/ --output post.md

Prerequisites

For annotate-talk, you need poppler-utils:

# macOS
brew install poppler

# Ubuntu/Debian
apt-get install poppler-utils

Development

Running Tests

./test.sh

Version Management

The Makefile includes version bump commands that update both pyproject.toml and __init__.py:

# Bump versions
make bump-patch     # 0.1.0 -> 0.1.1
make bump-minor     # 0.1.0 -> 0.2.0  
make bump-major     # 0.1.0 -> 1.0.0

# Create a release (bump + git tag)
make release-patch  # Bumps patch and tags
make release-minor  # Bumps minor and tags
make release-major  # Bumps major and tags

Publishing to PyPI

Setup

  1. Install publishing tools:

    make install-publish-tools
    
  2. Configure twine (see .pypirc.example):

    cp .pypirc.example ~/.pypirc
    # Edit ~/.pypirc with your PyPI tokens
    

Release Workflow

# 1. Create a release
make release-minor  # or release-patch, release-major

# 2. Push to GitHub
git push && git push --tags

# 3. Build and check
make check

# 4. Upload to PyPI
make test-upload  # Test first
make upload       # Then production

The Makefile uses twine for secure uploads and includes:

  • make check - Validates distributions before upload
  • make test-upload - Tests on TestPyPI first
  • make upload - Publishes to PyPI with confirmation prompt

Architecture

Each tool is implemented as a Typer CLI application that wraps functionality from the hamel library:

  • transcribe.pyhamel.yt.transcribe()
  • chapters.pyhamel.yt.yt_chapters()
  • annotate_talk.pyhamel.writing.generate_annotated_talk_post()

The tools follow a consistent pattern using Typer's app decorator approach without if __name__ == "__main__" blocks.

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

hamel_tools-0.2.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

hamel_tools-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hamel_tools-0.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for hamel_tools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 16f3475bf4f0786246b37000db789eb972ebfef6e570eef8b494a0b08df69952
MD5 353cdd5214b931175382d88b78cc5392
BLAKE2b-256 f2fd8cdb5db7df96c3f801103979ec226fb685882bd0c649bca63ed5c10f5db1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hamel_tools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for hamel_tools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fc93bb7ea3d1e25e7ff392cbd61c8cd6b7acaebe015346e757227091acc0f8b
MD5 bb15d5f78c78e6b7f12d5ca13d5cc1d0
BLAKE2b-256 25f220c335fdf9541427c7d0f97547e5ee71288664794ce7f02cfde1568b23d0

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