talk-python-cli 0.1.2__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
 
3
3
  from importlib.metadata import version
4
4
 
5
- __version__ = version("talk-python-cli")
5
+ __version__ = version('talk-python-cli')
talk_python_cli/app.py CHANGED
@@ -82,10 +82,10 @@ def status() -> None:
82
82
  def launcher(
83
83
  *tokens: Annotated[str, cyclopts.Parameter(show=False, allow_leading_hyphen=True)],
84
84
  format: Annotated[
85
- Literal['text', 'json'],
85
+ Literal['text', 'json', 'markdown'],
86
86
  cyclopts.Parameter(
87
87
  name='--format',
88
- help="Output format: 'text' (rich Markdown) or 'json'.",
88
+ help="Output format: 'text' (rich Markdown), 'json', or 'markdown' (raw).",
89
89
  ),
90
90
  ] = 'text',
91
91
  url: Annotated[
talk_python_cli/client.py CHANGED
@@ -46,8 +46,8 @@ class MCPClient:
46
46
  return self._msg_id
47
47
 
48
48
  def _url(self) -> str:
49
- if self.output_format == 'json':
50
- return f'{self.base_url}?format=json'
49
+ if self.output_format in ('json', 'markdown'):
50
+ return f'{self.base_url}?format={self.output_format}'
51
51
  return self.base_url
52
52
 
53
53
  def _post(self, payload: dict) -> httpx.Response:
@@ -39,10 +39,17 @@ def display(content: str, output_format: str) -> None:
39
39
  """Route content to the appropriate renderer."""
40
40
  if output_format == 'json':
41
41
  display_json(content)
42
+ elif output_format == 'markdown':
43
+ display_markdown_raw(content)
42
44
  else:
43
45
  display_markdown(content)
44
46
 
45
47
 
48
+ def display_markdown_raw(content: str) -> None:
49
+ """Print raw Markdown content to stdout without any Rich formatting."""
50
+ print(content)
51
+
52
+
46
53
  def display_markdown(content: str) -> None:
47
54
  """Render Markdown content with Rich, wrapped in a styled panel."""
48
55
  md = Markdown(content, code_theme='monokai')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talk-python-cli
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: CLI for the Talk Python to Me podcast and courses
5
5
  Project-URL: Homepage, https://github.com/talkpython/talk-python-cli
6
6
  Project-URL: Source, https://github.com/talkpython/talk-python-cli
@@ -44,12 +44,12 @@ Unlock 500+ episodes of [Talk Python to Me](https://talkpython.fm), full transcr
44
44
  Requires Python 3.12+.
45
45
 
46
46
  ```bash
47
- # Try it instantly with uvx (no install needed)
48
- uvx --from talk-python-cli talkpython episodes recent
49
-
50
- # Or install it permanently with uv
47
+ # Install it permanently with uv
51
48
  uv tool install talk-python-cli
52
49
 
50
+ # Or try it instantly with uvx (no install needed)
51
+ uvx --from talk-python-cli talkpython episodes recent
52
+
53
53
  # Or with pip
54
54
  pip install talk-python-cli
55
55
  ```
@@ -58,6 +58,8 @@ This installs the `talkpython` command.
58
58
 
59
59
  ## Quick start
60
60
 
61
+ Copy this whole block and paste it into your terminal to see what you get.
62
+
61
63
  ```bash
62
64
  # Search for episodes about FastAPI
63
65
  talkpython episodes search "FastAPI"
@@ -109,41 +111,55 @@ talkpython courses list
109
111
 
110
112
  ## Output formats
111
113
 
112
- The CLI auto-detects the best output format:
114
+ The CLI supports three output formats via `--format`:
113
115
 
114
- - **Interactive terminal** — Rich-formatted Markdown with styled panels and color.
115
- - **Piped / redirected** Compact JSON, ready for processing.
116
-
117
- Override the default with `--format`:
116
+ - **`text`** (default) — Rich-formatted Markdown with styled panels and color for human reading.
117
+ - **`json`**Structured JSON, pretty-printed on a TTY or compact when piped.
118
+ - **`markdown`** — Raw Markdown output with no Rich formatting. Ideal for piping into AI agents, LLMs, and automation tools that consume Markdown natively.
118
119
 
119
120
  ```bash
120
121
  # Force JSON output in the terminal
121
122
  talkpython --format json episodes search "async"
122
123
 
124
+ # Raw Markdown for AI agents and LLM pipelines
125
+ talkpython --format markdown episodes get 535
126
+
123
127
  # Force rich text output even when piping
124
128
  talkpython --format text episodes recent | less -R
125
129
  ```
126
130
 
131
+ ## Agentic AI and LLM integration
132
+
133
+ Use `--format markdown` when feeding output to AI agents, LLMs, or RAG pipelines. This gives you clean, raw Markdown without terminal styling — exactly what language models expect:
134
+
135
+ ```bash
136
+ # Feed an episode summary to an LLM
137
+ talkpython --format markdown episodes get 535 | llm "Summarize this podcast episode"
138
+
139
+ # Grab a transcript for RAG ingestion
140
+ talkpython --format markdown episodes transcript 535 | your-rag-pipeline ingest
141
+
142
+ # Pipe course details into an AI agent
143
+ talkpython --format markdown courses get 57 | your-agent process
144
+ ```
145
+
127
146
  ## Piping JSON to other tools
128
147
 
129
- Because the CLI outputs JSON automatically when piped, it integrates naturally with tools like `jq`, `llm`, or your own scripts:
148
+ The `--format json` output integrates naturally with tools like `jq` or your own scripts:
130
149
 
131
150
  ```bash
132
151
  # Extract episode titles with jq
133
- talkpython episodes search "testing" | jq '.title'
152
+ talkpython --format json episodes search "testing" | jq '.title'
134
153
 
135
- # Feed episode data into an LLM
136
- talkpython episodes get 535 | llm "Summarize this podcast episode"
137
-
138
- # Grab a transcript for RAG ingestion
139
- talkpython episodes transcript 535 | your-rag-pipeline ingest
154
+ # Process structured data in a script
155
+ talkpython --format json episodes recent | python process_episodes.py
140
156
  ```
141
157
 
142
158
  ## Global options
143
159
 
144
160
  | Option | Description |
145
161
  |--------|-------------|
146
- | `--format text\|json` | Force output format (auto-detected by default) |
162
+ | `--format text\|json\|markdown` | Output format: `text` (rich), `json`, or `markdown` (raw) |
147
163
  | `--url <mcp-url>` | Override the MCP server URL (default: `https://talkpython.fm/api/mcp`) |
148
164
  | `--version`, `-V` | Show version |
149
165
 
@@ -0,0 +1,13 @@
1
+ talk_python_cli/__init__.py,sha256=9AFzBQG3tsc9-2x-DHoI0zsd_ItUNTySlkMnTHzHS1k,159
2
+ talk_python_cli/__main__.py,sha256=CiR9VEA51QfEByCah9e1uvR7gqiFDoBmsRgFVWltjBU,100
3
+ talk_python_cli/app.py,sha256=FoF_psdIKyIQrG-HeT5Hkedf82SX7gsQv9nMD--tcFE,4280
4
+ talk_python_cli/client.py,sha256=xTRF2np0hOQuqJWL5uOsRLv8_MKEKdLDskzUFv5eC6Q,4808
5
+ talk_python_cli/courses.py,sha256=EgWFbhLFeBTotDHu3xZ4fyiJokgWY2ZLFVaDRTU6NNo,1478
6
+ talk_python_cli/episodes.py,sha256=7Mm6uZ_jzMV6JBPv-1xbmINo7eyI4ylKvsT4_xT3Umw,2453
7
+ talk_python_cli/formatting.py,sha256=NmozYqluukNo0FTUNcCO6sVl9WH0xBvd-h1xpuEsDds,2920
8
+ talk_python_cli/guests.py,sha256=O5MpmnhbACx1czKbV_p9KZywRwEo4jxOM5y8oU3ix50,1314
9
+ talk_python_cli-0.2.0.dist-info/METADATA,sha256=59k7wQgqJD5s9tq35Z3x0gND9FoE5tkwTVkDcPvMRVo,6686
10
+ talk_python_cli-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
11
+ talk_python_cli-0.2.0.dist-info/entry_points.txt,sha256=Q7eLneKcuKeoSY_Ps-RyMb8BF1q6QPytIZ0ZYm7fhBg,56
12
+ talk_python_cli-0.2.0.dist-info/licenses/LICENSE,sha256=E1rfm5mKKkNGtHcctSAevPdM0uk6DqdPlcM48R1jGM4,1068
13
+ talk_python_cli-0.2.0.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- talk_python_cli/__init__.py,sha256=WEWAhfkC1qyOUqqsiLcIFzkQD3f3f1gvCv3jYUzGsxY,159
2
- talk_python_cli/__main__.py,sha256=CiR9VEA51QfEByCah9e1uvR7gqiFDoBmsRgFVWltjBU,100
3
- talk_python_cli/app.py,sha256=WdLzK60FqO9WPChyt1VMKu8h0V3CsaPNaXl7gmJykxI,4249
4
- talk_python_cli/client.py,sha256=NR48azeJlfHYFMqikUSjfrFOmCVClyOlq4yd0hyvxHY,4778
5
- talk_python_cli/courses.py,sha256=EgWFbhLFeBTotDHu3xZ4fyiJokgWY2ZLFVaDRTU6NNo,1478
6
- talk_python_cli/episodes.py,sha256=7Mm6uZ_jzMV6JBPv-1xbmINo7eyI4ylKvsT4_xT3Umw,2453
7
- talk_python_cli/formatting.py,sha256=Ww3pfIAK50Ms2MSSkKrKjvwam_5C3ltEB1klHRGeM8U,2699
8
- talk_python_cli/guests.py,sha256=O5MpmnhbACx1czKbV_p9KZywRwEo4jxOM5y8oU3ix50,1314
9
- talk_python_cli-0.1.2.dist-info/METADATA,sha256=AAuz2HdkW7KNEjP-oD__-1sWg6B33ckaNuL1eoKns3U,5877
10
- talk_python_cli-0.1.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
11
- talk_python_cli-0.1.2.dist-info/entry_points.txt,sha256=Q7eLneKcuKeoSY_Ps-RyMb8BF1q6QPytIZ0ZYm7fhBg,56
12
- talk_python_cli-0.1.2.dist-info/licenses/LICENSE,sha256=E1rfm5mKKkNGtHcctSAevPdM0uk6DqdPlcM48R1jGM4,1068
13
- talk_python_cli-0.1.2.dist-info/RECORD,,