|
1 | | -# talk-python-cli |
2 | | -A CLI interface to run Inquiries against the TalkPythonToMe podcast data. |
| 1 | +# Talk Python CLI |
| 2 | + |
| 3 | +A command-line interface for accessing [Talk Python to Me](https://talkpython.fm) podcast episodes, guest information, and [Talk Python Training](https://training.talkpython.fm) courses. Built on the Talk Python [MCP server](https://talkpython.fm/api/mcp), it gives you structured access to the full Talk Python catalog from your terminal. |
| 4 | + |
| 5 | +## Why use this? |
| 6 | + |
| 7 | +- **Automation** — Query episode data, guest info, and course catalogs from scripts and pipelines. |
| 8 | +- **LLM & AI integration** — Pipe JSON output directly into AI agents, RAG systems, or chat workflows. |
| 9 | +- **Quick lookups** — Search episodes, pull transcripts, and browse courses without leaving the terminal. |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +Requires Python 3.12+. |
| 14 | + |
| 15 | +```bash |
| 16 | +# With uv (recommended) |
| 17 | +uv tool install talk-python-cli |
| 18 | + |
| 19 | +# With pip |
| 20 | +pip install talk-python-cli |
| 21 | +``` |
| 22 | + |
| 23 | +This installs the `talkpython` command. |
| 24 | + |
| 25 | +## Quick start |
| 26 | + |
| 27 | +```bash |
| 28 | +# Search for episodes about FastAPI |
| 29 | +talkpython episodes search "FastAPI" |
| 30 | + |
| 31 | +# Get full details for a specific episode |
| 32 | +talkpython episodes get 535 |
| 33 | + |
| 34 | +# Pull the transcript for an episode |
| 35 | +talkpython episodes transcript 535 |
| 36 | + |
| 37 | +# List recent episodes |
| 38 | +talkpython episodes recent --limit 5 |
| 39 | + |
| 40 | +# Search for a guest |
| 41 | +talkpython guests search "Hynek" |
| 42 | + |
| 43 | +# Browse all training courses |
| 44 | +talkpython courses list |
| 45 | +``` |
| 46 | + |
| 47 | +## Commands |
| 48 | + |
| 49 | +### Episodes |
| 50 | + |
| 51 | +| Command | Description | |
| 52 | +|---------|-------------| |
| 53 | +| `talkpython episodes search <query> [--limit N]` | Search episodes by keyword (default limit: 10) | |
| 54 | +| `talkpython episodes get <show_id>` | Get full details for an episode | |
| 55 | +| `talkpython episodes list` | List all episodes | |
| 56 | +| `talkpython episodes recent [--limit N]` | Get the most recent episodes | |
| 57 | +| `talkpython episodes transcript <show_id>` | Get the plain-text transcript | |
| 58 | +| `talkpython episodes transcript-vtt <show_id>` | Get the WebVTT transcript (with timestamps) | |
| 59 | + |
| 60 | +### Guests |
| 61 | + |
| 62 | +| Command | Description | |
| 63 | +|---------|-------------| |
| 64 | +| `talkpython guests search <query> [--limit N]` | Search guests by name | |
| 65 | +| `talkpython guests get <guest_id>` | Get details for a specific guest | |
| 66 | +| `talkpython guests list` | List all guests, sorted by number of appearances | |
| 67 | + |
| 68 | +### Courses |
| 69 | + |
| 70 | +| Command | Description | |
| 71 | +|---------|-------------| |
| 72 | +| `talkpython courses search <query> [--course_id N]` | Search courses, chapters, and lectures | |
| 73 | +| `talkpython courses get <course_id>` | Get full course details including chapters and lectures | |
| 74 | +| `talkpython courses list` | List all available training courses | |
| 75 | + |
| 76 | +## Output formats |
| 77 | + |
| 78 | +The CLI auto-detects the best output format: |
| 79 | + |
| 80 | +- **Interactive terminal** — Rich-formatted Markdown with styled panels and color. |
| 81 | +- **Piped / redirected** — Compact JSON, ready for processing. |
| 82 | + |
| 83 | +Override the default with `--format`: |
| 84 | + |
| 85 | +```bash |
| 86 | +# Force JSON output in the terminal |
| 87 | +talkpython --format json episodes search "async" |
| 88 | + |
| 89 | +# Force rich text output even when piping |
| 90 | +talkpython --format text episodes recent | less -R |
| 91 | +``` |
| 92 | + |
| 93 | +## Piping JSON to other tools |
| 94 | + |
| 95 | +Because the CLI outputs JSON automatically when piped, it integrates naturally with tools like `jq`, `llm`, or your own scripts: |
| 96 | + |
| 97 | +```bash |
| 98 | +# Extract episode titles with jq |
| 99 | +talkpython episodes search "testing" | jq '.title' |
| 100 | + |
| 101 | +# Feed episode data into an LLM |
| 102 | +talkpython episodes get 535 | llm "Summarize this podcast episode" |
| 103 | + |
| 104 | +# Grab a transcript for RAG ingestion |
| 105 | +talkpython episodes transcript 535 | your-rag-pipeline ingest |
| 106 | +``` |
| 107 | + |
| 108 | +## Global options |
| 109 | + |
| 110 | +| Option | Description | |
| 111 | +|--------|-------------| |
| 112 | +| `--format text\|json` | Force output format (auto-detected by default) | |
| 113 | +| `--url <mcp-url>` | Override the MCP server URL (default: `https://talkpython.fm/api/mcp`) | |
| 114 | +| `--version`, `-V` | Show version | |
| 115 | + |
| 116 | +## License |
| 117 | + |
| 118 | +MIT |
0 commit comments