talk-python-cli 0.1.1__tar.gz → 0.1.2__tar.gz
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.
- talk_python_cli-0.1.2/.claude/settings.local.json +11 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/PKG-INFO +2 -2
- talk_python_cli-0.1.2/change-log.md +67 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/pyproject.toml +2 -2
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/app.py +38 -7
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/uv.lock +1 -1
- talk_python_cli-0.1.1/.claude/settings.local.json +0 -7
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/.gitignore +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/LICENSE +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/README.md +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/plans/001-talk-python-cli.plan.md +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/pyrefly.toml +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/ruff.toml +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/__init__.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/__main__.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/client.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/courses.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/episodes.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/formatting.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/src/talk_python_cli/guests.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/tests/__init__.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/tests/conftest.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/tests/test_client.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/tests/test_courses.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/tests/test_episodes.py +0 -0
- {talk_python_cli-0.1.1 → talk_python_cli-0.1.2}/tests/test_guests.py +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(UV_PROJECT_ENVIRONMENT=venv uv run pytest:*)",
|
|
5
|
+
"Bash(./venv/bin/python -m talk_python_cli.app status:*)",
|
|
6
|
+
"Bash(./venv/bin/talkpython status:*)",
|
|
7
|
+
"Bash(./venv/bin/pip install:*)",
|
|
8
|
+
"Bash(./venv/bin/talkpython:*)"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: talk-python-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
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
|
|
@@ -8,7 +8,7 @@ Project-URL: Documentation, https://github.com/talkpython/talk-python-cli
|
|
|
8
8
|
Author-email: Michael Kennedy <michael@talkpython.fm>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Classifier: Development Status ::
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Environment :: Console
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.2] - 2026-02-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `talkpython status` command to check MCP server health and display version info
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Version is now read dynamically from package metadata via `importlib.metadata`
|
|
15
|
+
- Default output format is now always `text` (removed auto-detect that defaulted to `json` when piped)
|
|
16
|
+
- Development status upgraded from Alpha to Beta
|
|
17
|
+
- Added `readme` field to `pyproject.toml` so PyPI renders the README
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## [0.1.0] - 2026-02-06
|
|
22
|
+
|
|
23
|
+
Initial release of the Talk Python CLI.
|
|
24
|
+
|
|
25
|
+
- Query podcast episodes by number or keyword
|
|
26
|
+
- Look up guest appearances
|
|
27
|
+
- Browse and search the Talk Python course catalog
|
|
28
|
+
- Rich terminal output with Markdown rendering
|
|
29
|
+
- JSON output mode via `--format json`
|
|
30
|
+
- Configurable MCP server URL via `--url`
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Template for Future Entries
|
|
35
|
+
|
|
36
|
+
<!--
|
|
37
|
+
## [X.Y.Z] - YYYY-MM-DD
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- New features or capabilities
|
|
41
|
+
- Files: `path/to/new/file.ext`, `another/file.ext`
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
- Modifications to existing functionality
|
|
45
|
+
- Files: `path/to/modified/file.ext` (summary if many files)
|
|
46
|
+
|
|
47
|
+
### Deprecated
|
|
48
|
+
- Features that will be removed in future versions
|
|
49
|
+
- Files affected: `path/to/deprecated/file.ext`
|
|
50
|
+
|
|
51
|
+
### Removed
|
|
52
|
+
- Features or files that were deleted
|
|
53
|
+
- Files: `path/to/removed/file.ext`
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
- Bug fixes and corrections
|
|
57
|
+
- Files: `path/to/fixed/file.ext`
|
|
58
|
+
|
|
59
|
+
### Security
|
|
60
|
+
- Security patches or vulnerability fixes
|
|
61
|
+
- Files: `path/to/security/file.ext`
|
|
62
|
+
|
|
63
|
+
### Notes
|
|
64
|
+
- Additional context or important information
|
|
65
|
+
- Major dependencies updated
|
|
66
|
+
- Breaking changes explanation
|
|
67
|
+
-->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "talk-python-cli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.2"
|
|
4
4
|
description = "CLI for the Talk Python to Me podcast and courses"
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
license = "MIT"
|
|
@@ -8,7 +8,7 @@ authors = [
|
|
|
8
8
|
{ name = "Michael Kennedy", email = "michael@talkpython.fm" },
|
|
9
9
|
]
|
|
10
10
|
classifiers = [
|
|
11
|
-
"Development Status ::
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
12
|
"Environment :: Console",
|
|
13
13
|
"Intended Audience :: Developers",
|
|
14
14
|
"License :: OSI Approved :: MIT License",
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import json
|
|
5
6
|
import sys
|
|
7
|
+
import time
|
|
6
8
|
from typing import Annotated, Literal
|
|
7
9
|
|
|
8
10
|
import cyclopts
|
|
11
|
+
import httpx
|
|
9
12
|
|
|
10
13
|
from talk_python_cli import __version__
|
|
11
14
|
from talk_python_cli.client import DEFAULT_URL, MCPClient
|
|
12
|
-
from talk_python_cli.formatting import
|
|
15
|
+
from talk_python_cli.formatting import console, display_json, print_error
|
|
13
16
|
|
|
14
17
|
# ── Shared state ─────────────────────────────────────────────────────────────
|
|
15
18
|
# The meta-app handler stores the client here so command modules can access it.
|
|
@@ -42,6 +45,38 @@ app.command(guests_app)
|
|
|
42
45
|
app.command(courses_app)
|
|
43
46
|
|
|
44
47
|
|
|
48
|
+
@app.command
|
|
49
|
+
def status() -> None:
|
|
50
|
+
"""Check whether the Talk Python MCP server is up and display its version info."""
|
|
51
|
+
base = _client.base_url if _client else DEFAULT_URL
|
|
52
|
+
t0 = time.monotonic()
|
|
53
|
+
try:
|
|
54
|
+
resp = httpx.get(base, timeout=15.0)
|
|
55
|
+
elapsed_ms = (time.monotonic() - t0) * 1000
|
|
56
|
+
resp.raise_for_status()
|
|
57
|
+
data = resp.json()
|
|
58
|
+
except httpx.HTTPError as exc:
|
|
59
|
+
elapsed_ms = (time.monotonic() - t0) * 1000
|
|
60
|
+
console.print(f'[tp.error]STATUS: FAILED ({elapsed_ms:.2f} ms)[/tp.error]')
|
|
61
|
+
console.print(f'[red]{exc}[/red]')
|
|
62
|
+
sys.exit(1)
|
|
63
|
+
|
|
64
|
+
# If piped / --format json, emit raw JSON
|
|
65
|
+
if _client and _client.output_format == 'json':
|
|
66
|
+
data['status'] = 'SUCCESS'
|
|
67
|
+
data['response_ms'] = round(elapsed_ms, 2)
|
|
68
|
+
display_json(json.dumps(data))
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
console.print()
|
|
72
|
+
console.print(f'[tp.success]STATUS: SUCCESS[/tp.success] [tp.dim]({elapsed_ms:.2f} ms)[/tp.dim]')
|
|
73
|
+
console.print()
|
|
74
|
+
for key in ('name', 'version', 'description', 'documentation'):
|
|
75
|
+
if key in data:
|
|
76
|
+
console.print(f'[tp.label]{key}:[/tp.label] {data[key]}')
|
|
77
|
+
console.print()
|
|
78
|
+
|
|
79
|
+
|
|
45
80
|
# ── Meta-app: handles global options before dispatching to sub-commands ──────
|
|
46
81
|
@app.meta.default
|
|
47
82
|
def launcher(
|
|
@@ -50,9 +85,9 @@ def launcher(
|
|
|
50
85
|
Literal['text', 'json'],
|
|
51
86
|
cyclopts.Parameter(
|
|
52
87
|
name='--format',
|
|
53
|
-
help="Output format: 'text' (rich Markdown) or 'json'.
|
|
88
|
+
help="Output format: 'text' (rich Markdown) or 'json'.",
|
|
54
89
|
),
|
|
55
|
-
] =
|
|
90
|
+
] = 'text',
|
|
56
91
|
url: Annotated[
|
|
57
92
|
str,
|
|
58
93
|
cyclopts.Parameter(
|
|
@@ -64,10 +99,6 @@ def launcher(
|
|
|
64
99
|
) -> None:
|
|
65
100
|
global _client
|
|
66
101
|
|
|
67
|
-
# Auto-detect: default to json when piped, text when interactive
|
|
68
|
-
if format is None:
|
|
69
|
-
format = 'text' if is_tty() else 'json'
|
|
70
|
-
|
|
71
102
|
_client = MCPClient(base_url=url, output_format=format)
|
|
72
103
|
try:
|
|
73
104
|
app(tokens)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|