podojo-cli 1.30.0__tar.gz → 1.31.0__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.
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/CHANGELOG.md +12 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/PKG-INFO +5 -1
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/README.md +4 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/pyproject.toml +1 -1
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/aiinterviews.py +3 -2
- podojo_cli-1.31.0/src/podojo_cli/commands/transcripts.py +105 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/usertests.py +3 -2
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/videos.py +3 -2
- podojo_cli-1.31.0/src/podojo_cli/tables.py +13 -0
- podojo_cli-1.31.0/tests/test_transcripts.py +97 -0
- podojo_cli-1.31.0/tests/test_videos.py +28 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/uv.lock +1 -1
- podojo_cli-1.30.0/src/podojo_cli/commands/transcripts.py +0 -58
- podojo_cli-1.30.0/tests/test_transcripts.py +0 -30
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/.github/workflows/publish.yml +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/.gitignore +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/CLAUDE.md +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/LICENSE +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/__init__.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/client.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/__init__.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/auth.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/interviews.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/projects.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/showreel.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/commands/synth.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/config.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/main.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/synth/__init__.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/synth/driver.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/synth/session.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/version_check.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/video/__init__.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/src/podojo_cli/video/showreel.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/conftest.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/test_aiinterviews.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/test_auth.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/test_interviews.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/test_projects.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/test_showreel.py +0 -0
- {podojo_cli-1.30.0 → podojo_cli-1.31.0}/tests/test_usertests.py +0 -0
|
@@ -5,6 +5,18 @@ All notable changes to the Podojo CLI will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org).
|
|
7
7
|
|
|
8
|
+
## [1.31.0] - 2026-11-03
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `transcripts download <project> --all -o <folder>` downloads every transcript
|
|
12
|
+
in a project, one `<name> - <batch-id>.txt` per interview, and lists the
|
|
13
|
+
interviews that have no transcript yet.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- List tables no longer cut batch, interview and user test IDs. Off a terminal
|
|
17
|
+
(Claude Code, a pipe) they were squeezed to 80 columns and IDs ended in "…",
|
|
18
|
+
so agents guessed the rest and got 404s; tables now print at full width there.
|
|
19
|
+
|
|
8
20
|
## [1.30.0] - 2026-10-31
|
|
9
21
|
|
|
10
22
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: podojo-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.31.0
|
|
4
4
|
Summary: CLI for the Podojo user research platform
|
|
5
5
|
Project-URL: Homepage, https://github.com/podojo/cli-podojo
|
|
6
6
|
Project-URL: Source, https://github.com/podojo/cli-podojo
|
|
@@ -92,8 +92,12 @@ podojo projects create "Checkout Redesign" --brief "Q1 usability study"
|
|
|
92
92
|
podojo interviews upload session-03.mp4 --project "Checkout Redesign"
|
|
93
93
|
podojo transcripts list "Checkout Redesign"
|
|
94
94
|
podojo transcripts download "Checkout Redesign" <batch-id> -o transcript.txt
|
|
95
|
+
podojo transcripts download "Checkout Redesign" --all -o transcripts/
|
|
95
96
|
```
|
|
96
97
|
|
|
98
|
+
`--all` saves one `<name> - <batch-id>.txt` per interview, so each file carries
|
|
99
|
+
its batch ID for showreel clips.
|
|
100
|
+
|
|
97
101
|
### Videos & showreels
|
|
98
102
|
|
|
99
103
|
```bash
|
|
@@ -60,8 +60,12 @@ podojo projects create "Checkout Redesign" --brief "Q1 usability study"
|
|
|
60
60
|
podojo interviews upload session-03.mp4 --project "Checkout Redesign"
|
|
61
61
|
podojo transcripts list "Checkout Redesign"
|
|
62
62
|
podojo transcripts download "Checkout Redesign" <batch-id> -o transcript.txt
|
|
63
|
+
podojo transcripts download "Checkout Redesign" --all -o transcripts/
|
|
63
64
|
```
|
|
64
65
|
|
|
66
|
+
`--all` saves one `<name> - <batch-id>.txt` per interview, so each file carries
|
|
67
|
+
its batch ID for showreel clips.
|
|
68
|
+
|
|
65
69
|
### Videos & showreels
|
|
66
70
|
|
|
67
71
|
```bash
|
|
@@ -8,6 +8,7 @@ from rich.table import Table
|
|
|
8
8
|
|
|
9
9
|
from ..client import PodojoClient
|
|
10
10
|
from ..config import load_config
|
|
11
|
+
from ..tables import print_table
|
|
11
12
|
|
|
12
13
|
app = typer.Typer(help="Manage AI voice interviews")
|
|
13
14
|
console = Console()
|
|
@@ -436,7 +437,7 @@ def list_ai_interviews(
|
|
|
436
437
|
return
|
|
437
438
|
|
|
438
439
|
table = Table(title="AI Interviews")
|
|
439
|
-
table.add_column("Interview ID")
|
|
440
|
+
table.add_column("Interview ID", no_wrap=True)
|
|
440
441
|
table.add_column("Title")
|
|
441
442
|
table.add_column("Language")
|
|
442
443
|
table.add_column("Questions", justify="right")
|
|
@@ -459,7 +460,7 @@ def list_ai_interviews(
|
|
|
459
460
|
s.get("last_updated", ""),
|
|
460
461
|
)
|
|
461
462
|
|
|
462
|
-
console
|
|
463
|
+
print_table(console, table)
|
|
463
464
|
|
|
464
465
|
|
|
465
466
|
@app.command("get")
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
from rich.table import Table
|
|
8
|
+
|
|
9
|
+
from ..client import PodojoClient
|
|
10
|
+
from ..tables import print_table
|
|
11
|
+
|
|
12
|
+
app = typer.Typer(help="Manage transcripts")
|
|
13
|
+
console = Console()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _format_date(value) -> str:
|
|
17
|
+
if not value:
|
|
18
|
+
return ""
|
|
19
|
+
try:
|
|
20
|
+
return datetime.fromisoformat(value.replace("Z", "+00:00")).strftime("%Y-%m-%d %H:%M")
|
|
21
|
+
except (ValueError, AttributeError):
|
|
22
|
+
return str(value)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _filename(interview: dict) -> str:
|
|
26
|
+
"""Name plus batch ID, so a file maps back to its batch ID without a
|
|
27
|
+
lookup. Characters file systems reject become "_"."""
|
|
28
|
+
batch_id = interview["batch_id"]
|
|
29
|
+
name = re.sub(r'[\x00-\x1f/\\:*?"<>|]', "_", (interview.get("batch_name") or "").strip())
|
|
30
|
+
return f"{name} - {batch_id}.txt" if name else f"{batch_id}.txt"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@app.command("list")
|
|
34
|
+
def list_transcripts(project: str = typer.Argument(help="Project name")):
|
|
35
|
+
"""List transcripts for a project."""
|
|
36
|
+
client = PodojoClient()
|
|
37
|
+
data = client.list_transcripts(project)
|
|
38
|
+
|
|
39
|
+
table = Table(title=f"Transcripts — {project} ({data['total']} total)")
|
|
40
|
+
table.add_column("Date")
|
|
41
|
+
table.add_column("Batch ID", no_wrap=True)
|
|
42
|
+
table.add_column("Name")
|
|
43
|
+
|
|
44
|
+
for t in data["interviews"]:
|
|
45
|
+
table.add_row(
|
|
46
|
+
_format_date(t.get("date")),
|
|
47
|
+
t.get("batch_id", ""),
|
|
48
|
+
t.get("batch_name", ""),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
print_table(console, table)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _download_all(client: PodojoClient, project: str, folder: Path) -> None:
|
|
55
|
+
data = client.list_transcripts(project)
|
|
56
|
+
interviews = data["interviews"]
|
|
57
|
+
folder.mkdir(parents=True, exist_ok=True)
|
|
58
|
+
|
|
59
|
+
missing = []
|
|
60
|
+
for interview in interviews:
|
|
61
|
+
text = client.download_transcript(project, interview["batch_id"])
|
|
62
|
+
if not text.strip():
|
|
63
|
+
missing.append(interview.get("batch_name") or interview["batch_id"])
|
|
64
|
+
continue
|
|
65
|
+
path = folder / _filename(interview)
|
|
66
|
+
path.write_text(text, encoding="utf-8")
|
|
67
|
+
console.print(f"Saved {path}", soft_wrap=True, markup=False)
|
|
68
|
+
|
|
69
|
+
console.print(
|
|
70
|
+
f"Downloaded {len(interviews) - len(missing)} transcripts to {folder}",
|
|
71
|
+
soft_wrap=True,
|
|
72
|
+
markup=False,
|
|
73
|
+
)
|
|
74
|
+
if missing:
|
|
75
|
+
console.print(f"No transcript yet: {', '.join(missing)}", soft_wrap=True, markup=False)
|
|
76
|
+
if data["total"] > len(interviews):
|
|
77
|
+
console.print(f"Only the newest {len(interviews)} of {data['total']} interviews were downloaded.")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@app.command("download")
|
|
81
|
+
def download_transcript(
|
|
82
|
+
project: str = typer.Argument(help="Project name"),
|
|
83
|
+
batch_id: str = typer.Argument(None, help="Batch ID (leave out with --all)"),
|
|
84
|
+
all_: bool = typer.Option(False, "--all", help="Download every transcript in the project"),
|
|
85
|
+
output: Path = typer.Option(
|
|
86
|
+
None, "-o", "--output", help="Output file path, or the folder for --all (default: current folder)"
|
|
87
|
+
),
|
|
88
|
+
):
|
|
89
|
+
"""Download a transcript, or all of a project's transcripts with --all."""
|
|
90
|
+
if bool(batch_id) == all_:
|
|
91
|
+
console.print("[red]Error:[/red] Pass either a batch ID or --all.")
|
|
92
|
+
raise typer.Exit(1)
|
|
93
|
+
|
|
94
|
+
client = PodojoClient()
|
|
95
|
+
if all_:
|
|
96
|
+
_download_all(client, project, output or Path("."))
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
text = client.download_transcript(project, batch_id)
|
|
100
|
+
|
|
101
|
+
if output:
|
|
102
|
+
output.write_text(text, encoding="utf-8")
|
|
103
|
+
console.print(f"Saved to {output}")
|
|
104
|
+
else:
|
|
105
|
+
console.print(text)
|
|
@@ -7,6 +7,7 @@ from rich.console import Console
|
|
|
7
7
|
from rich.table import Table
|
|
8
8
|
|
|
9
9
|
from ..client import PodojoClient
|
|
10
|
+
from ..tables import print_table
|
|
10
11
|
|
|
11
12
|
app = typer.Typer(help="Manage unmoderated user tests")
|
|
12
13
|
console = Console()
|
|
@@ -423,7 +424,7 @@ def list_usertests(
|
|
|
423
424
|
return
|
|
424
425
|
|
|
425
426
|
table = Table(title="User Tests")
|
|
426
|
-
table.add_column("User Test ID")
|
|
427
|
+
table.add_column("User Test ID", no_wrap=True)
|
|
427
428
|
table.add_column("Title")
|
|
428
429
|
table.add_column("Steps", justify="right")
|
|
429
430
|
table.add_column("Live")
|
|
@@ -444,7 +445,7 @@ def list_usertests(
|
|
|
444
445
|
s.get("last_updated", ""),
|
|
445
446
|
)
|
|
446
447
|
|
|
447
|
-
console
|
|
448
|
+
print_table(console, table)
|
|
448
449
|
|
|
449
450
|
|
|
450
451
|
@app.command("get")
|
|
@@ -8,6 +8,7 @@ from rich.progress import Progress
|
|
|
8
8
|
from rich.table import Table
|
|
9
9
|
|
|
10
10
|
from ..client import PodojoClient
|
|
11
|
+
from ..tables import print_table
|
|
11
12
|
|
|
12
13
|
app = typer.Typer(help="Manage videos")
|
|
13
14
|
console = Console()
|
|
@@ -32,7 +33,7 @@ def list_videos(project: str = typer.Argument(help="Project name")):
|
|
|
32
33
|
|
|
33
34
|
table = Table(title=f"Videos — {project} ({data['total']} total)")
|
|
34
35
|
table.add_column("Date")
|
|
35
|
-
table.add_column("Batch ID")
|
|
36
|
+
table.add_column("Batch ID", no_wrap=True)
|
|
36
37
|
table.add_column("Name")
|
|
37
38
|
table.add_column("Duration (min)")
|
|
38
39
|
|
|
@@ -44,7 +45,7 @@ def list_videos(project: str = typer.Argument(help="Project name")):
|
|
|
44
45
|
str(v.get("duration_minutes", "")),
|
|
45
46
|
)
|
|
46
47
|
|
|
47
|
-
console
|
|
48
|
+
print_table(console, table)
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
@app.command("download")
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from rich.console import Console
|
|
2
|
+
from rich.table import Table
|
|
3
|
+
|
|
4
|
+
# Off a terminal (Claude Code, a pipe) Rich falls back to 80 columns and cuts
|
|
5
|
+
# cells with "…", so agents end up guessing the rest of a batch ID. Tables
|
|
6
|
+
# render at their natural width up to this one instead.
|
|
7
|
+
OFF_TERMINAL_WIDTH = 200
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def print_table(console: Console, table: Table) -> None:
|
|
11
|
+
if not console.is_terminal:
|
|
12
|
+
console = Console(width=OFF_TERMINAL_WIDTH)
|
|
13
|
+
console.print(table)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from podojo_cli.main import app
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_list_transcripts(runner, httpx_mock):
|
|
5
|
+
httpx_mock.add_response(
|
|
6
|
+
method="GET",
|
|
7
|
+
url="http://test.local/api/v1/projects/Alpha/transcripts",
|
|
8
|
+
json={
|
|
9
|
+
"project": "Alpha",
|
|
10
|
+
"total": 2,
|
|
11
|
+
"interviews": [
|
|
12
|
+
{
|
|
13
|
+
"batch_id": "batch-1",
|
|
14
|
+
"batch_name": "session_1",
|
|
15
|
+
"date": "2026-05-01T12:00:00",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"batch_id": "batch-2",
|
|
19
|
+
"batch_name": "session_2",
|
|
20
|
+
"date": "2026-05-02T12:00:00",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
result = runner.invoke(app, ["transcripts", "list", "Alpha"])
|
|
27
|
+
|
|
28
|
+
assert result.exit_code == 0
|
|
29
|
+
assert "batch-1" in result.output
|
|
30
|
+
assert "session_2" in result.output
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
BATCH_ID = "62d1b9bf-8f03-41d1-b5e0-d0c4bd0e7eb6"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def test_list_transcripts_keeps_batch_ids_whole_off_terminal(runner, httpx_mock, monkeypatch):
|
|
37
|
+
monkeypatch.setenv("COLUMNS", "80")
|
|
38
|
+
httpx_mock.add_response(
|
|
39
|
+
method="GET",
|
|
40
|
+
url="http://test.local/api/v1/projects/Alpha/transcripts",
|
|
41
|
+
json={
|
|
42
|
+
"project": "Alpha",
|
|
43
|
+
"total": 1,
|
|
44
|
+
"interviews": [
|
|
45
|
+
{"batch_id": BATCH_ID, "batch_name": "RapidUsertest 32721 1 (3)", "date": "2026-09-17T14:10:00"},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
result = runner.invoke(app, ["transcripts", "list", "Alpha"])
|
|
51
|
+
|
|
52
|
+
assert result.exit_code == 0
|
|
53
|
+
assert BATCH_ID in result.output
|
|
54
|
+
assert "RapidUsertest 32721 1 (3)" in result.output
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def test_download_all_transcripts(runner, httpx_mock, tmp_path):
|
|
58
|
+
httpx_mock.add_response(
|
|
59
|
+
method="GET",
|
|
60
|
+
url="http://test.local/api/v1/projects/Alpha/transcripts",
|
|
61
|
+
json={
|
|
62
|
+
"project": "Alpha",
|
|
63
|
+
"total": 3,
|
|
64
|
+
"interviews": [
|
|
65
|
+
{"batch_id": BATCH_ID, "batch_name": "Session 1/2"},
|
|
66
|
+
{"batch_id": "batch-2", "batch_name": "[DE] session_2"},
|
|
67
|
+
{"batch_id": "batch-3", "batch_name": "session_3"},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
)
|
|
71
|
+
httpx_mock.add_response(
|
|
72
|
+
method="GET", url=f"http://test.local/api/v1/projects/Alpha/transcripts/{BATCH_ID}", text="Hello"
|
|
73
|
+
)
|
|
74
|
+
httpx_mock.add_response(
|
|
75
|
+
method="GET", url="http://test.local/api/v1/projects/Alpha/transcripts/batch-2", text="Hallo"
|
|
76
|
+
)
|
|
77
|
+
httpx_mock.add_response(
|
|
78
|
+
method="GET", url="http://test.local/api/v1/projects/Alpha/transcripts/batch-3", text=""
|
|
79
|
+
)
|
|
80
|
+
folder = tmp_path / "transcripts"
|
|
81
|
+
|
|
82
|
+
result = runner.invoke(app, ["transcripts", "download", "Alpha", "--all", "-o", str(folder)])
|
|
83
|
+
|
|
84
|
+
assert result.exit_code == 0
|
|
85
|
+
assert (folder / f"Session 1_2 - {BATCH_ID}.txt").read_text() == "Hello"
|
|
86
|
+
assert (folder / "[DE] session_2 - batch-2.txt").read_text() == "Hallo"
|
|
87
|
+
assert sorted(p.name for p in folder.iterdir()) == [f"Session 1_2 - {BATCH_ID}.txt", "[DE] session_2 - batch-2.txt"]
|
|
88
|
+
assert "Downloaded 2 transcripts" in result.output
|
|
89
|
+
assert "No transcript yet: session_3" in result.output
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def test_download_transcript_needs_batch_id_or_all(runner):
|
|
93
|
+
for args in (["Alpha"], ["Alpha", "batch-1", "--all"]):
|
|
94
|
+
result = runner.invoke(app, ["transcripts", "download", *args])
|
|
95
|
+
|
|
96
|
+
assert result.exit_code == 1
|
|
97
|
+
assert "Pass either a batch ID or --all" in result.output
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from podojo_cli.main import app
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_list_videos_keeps_batch_ids_whole_off_terminal(runner, httpx_mock, monkeypatch):
|
|
5
|
+
monkeypatch.setenv("COLUMNS", "80")
|
|
6
|
+
batch_id = "62d1b9bf-8f03-41d1-b5e0-d0c4bd0e7eb6"
|
|
7
|
+
httpx_mock.add_response(
|
|
8
|
+
method="GET",
|
|
9
|
+
url="http://test.local/api/v1/projects/Alpha/videos",
|
|
10
|
+
json={
|
|
11
|
+
"project": "Alpha",
|
|
12
|
+
"total": 1,
|
|
13
|
+
"videos": [
|
|
14
|
+
{
|
|
15
|
+
"batch_id": batch_id,
|
|
16
|
+
"batch_name": "RapidUsertest 32721 1 (3)",
|
|
17
|
+
"batch_timestamp": "2026-09-17T14:10:00",
|
|
18
|
+
"duration_minutes": 12.4,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
result = runner.invoke(app, ["videos", "list", "Alpha"])
|
|
25
|
+
|
|
26
|
+
assert result.exit_code == 0
|
|
27
|
+
assert batch_id in result.output
|
|
28
|
+
assert "RapidUsertest 32721 1 (3)" in result.output
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
import typer
|
|
5
|
-
from rich.console import Console
|
|
6
|
-
from rich.table import Table
|
|
7
|
-
|
|
8
|
-
from ..client import PodojoClient
|
|
9
|
-
|
|
10
|
-
app = typer.Typer(help="Manage transcripts")
|
|
11
|
-
console = Console()
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def _format_date(value) -> str:
|
|
15
|
-
if not value:
|
|
16
|
-
return ""
|
|
17
|
-
try:
|
|
18
|
-
return datetime.fromisoformat(value.replace("Z", "+00:00")).strftime("%Y-%m-%d %H:%M")
|
|
19
|
-
except (ValueError, AttributeError):
|
|
20
|
-
return str(value)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@app.command("list")
|
|
24
|
-
def list_transcripts(project: str = typer.Argument(help="Project name")):
|
|
25
|
-
"""List transcripts for a project."""
|
|
26
|
-
client = PodojoClient()
|
|
27
|
-
data = client.list_transcripts(project)
|
|
28
|
-
|
|
29
|
-
table = Table(title=f"Transcripts — {project} ({data['total']} total)")
|
|
30
|
-
table.add_column("Date")
|
|
31
|
-
table.add_column("Batch ID")
|
|
32
|
-
table.add_column("Name")
|
|
33
|
-
|
|
34
|
-
for t in data["interviews"]:
|
|
35
|
-
table.add_row(
|
|
36
|
-
_format_date(t.get("date")),
|
|
37
|
-
t.get("batch_id", ""),
|
|
38
|
-
t.get("batch_name", ""),
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
console.print(table)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@app.command("download")
|
|
45
|
-
def download_transcript(
|
|
46
|
-
project: str = typer.Argument(help="Project name"),
|
|
47
|
-
batch_id: str = typer.Argument(help="Batch ID"),
|
|
48
|
-
output: Path = typer.Option(None, "-o", "--output", help="Output file path"),
|
|
49
|
-
):
|
|
50
|
-
"""Download a transcript."""
|
|
51
|
-
client = PodojoClient()
|
|
52
|
-
text = client.download_transcript(project, batch_id)
|
|
53
|
-
|
|
54
|
-
if output:
|
|
55
|
-
output.write_text(text, encoding="utf-8")
|
|
56
|
-
console.print(f"Saved to {output}")
|
|
57
|
-
else:
|
|
58
|
-
console.print(text)
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from podojo_cli.main import app
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_list_transcripts(runner, httpx_mock):
|
|
5
|
-
httpx_mock.add_response(
|
|
6
|
-
method="GET",
|
|
7
|
-
url="http://test.local/api/v1/projects/Alpha/transcripts",
|
|
8
|
-
json={
|
|
9
|
-
"project": "Alpha",
|
|
10
|
-
"total": 2,
|
|
11
|
-
"interviews": [
|
|
12
|
-
{
|
|
13
|
-
"batch_id": "batch-1",
|
|
14
|
-
"batch_name": "session_1",
|
|
15
|
-
"date": "2026-05-01T12:00:00",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"batch_id": "batch-2",
|
|
19
|
-
"batch_name": "session_2",
|
|
20
|
-
"date": "2026-05-02T12:00:00",
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
result = runner.invoke(app, ["transcripts", "list", "Alpha"])
|
|
27
|
-
|
|
28
|
-
assert result.exit_code == 0
|
|
29
|
-
assert "batch-1" in result.output
|
|
30
|
-
assert "session_2" in result.output
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|