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.1.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.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hamel_tools-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 c23176f259cfb05e820df209a4c18565e068060204687e0d2b243e3d738c34ba
MD5 b4d95388033a26010bfd16a67ee7fdd3
BLAKE2b-256 09e2729da9e9464f2198387bf07fb65e5111b038f5cf151f2f54f77cd6089679

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hamel_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc53d4d47eb448b1fa269f9df45cdaa8e6712480f9aca935e8fcf57ce55c5fa0
MD5 7c77cb4bc93d1fadddeb3233da1889a2
BLAKE2b-256 bc41f1214fa85d71f2bd76787b8851b9ce12639fe689a97fc66a140aad329f9c

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