slab-cli 0.29.0__tar.gz → 0.30.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.
- {slab_cli-0.29.0 → slab_cli-0.30.0}/PKG-INFO +2 -2
- {slab_cli-0.29.0 → slab_cli-0.30.0}/pyproject.toml +2 -2
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/breaks.py +20 -6
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/pricing.py +2 -2
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/display.py +5 -6
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/prompts.py +2 -1
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/theme.py +8 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/README.md +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/__init__.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/banner.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/browse.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/client.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/__init__.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/catalog.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/collection.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/custom_sets.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/export.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/lots.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/registry.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/setup.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/commands/update.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/config.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/context.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/flags.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/help.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/main.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/nav.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/paging.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/picker.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/platforms/__init__.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/platforms/base.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/platforms/posix.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/platforms/windows.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/sources.py +0 -0
- {slab_cli-0.29.0 → slab_cli-0.30.0}/src/slab_cli/updates.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: slab-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.30.0
|
|
4
4
|
Summary: CLI for the slab trading-card API — catalog, collect, and track your cards from the terminal.
|
|
5
5
|
Author: dev_jeb
|
|
6
|
-
Requires-Dist: slab-schemas>=0.
|
|
6
|
+
Requires-Dist: slab-schemas>=0.61.0
|
|
7
7
|
Requires-Dist: httpx>=0.27
|
|
8
8
|
Requires-Dist: rich>=13.0
|
|
9
9
|
Requires-Dist: inquirerpy>=0.3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "slab-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.30.0"
|
|
4
4
|
description = "CLI for the slab trading-card API — catalog, collect, and track your cards from the terminal."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{name = "dev_jeb"}]
|
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
|
12
12
|
# 0.34 reframes the grading desk from verdicts to break-even readings (BreakEvenRegion,
|
|
13
13
|
# GradingDesk.break_even) — the desk shows data, never tells the user to grade.
|
|
14
14
|
# 0.35 adds Liquidity/LiquidityLabel, which the market view's Sells column renders.
|
|
15
|
-
"slab-schemas>=0.
|
|
15
|
+
"slab-schemas>=0.61.0", # sales carry no marketplace
|
|
16
16
|
"httpx>=0.27",
|
|
17
17
|
"rich>=13.0",
|
|
18
18
|
"InquirerPy>=0.3",
|
|
@@ -13,6 +13,7 @@ from ..display import browse_breaks, console, render_break_pulls
|
|
|
13
13
|
from ..prompts import (
|
|
14
14
|
ask_date,
|
|
15
15
|
ask_decimal,
|
|
16
|
+
ask_int_optional,
|
|
16
17
|
ask_text,
|
|
17
18
|
confirm,
|
|
18
19
|
select_break,
|
|
@@ -20,6 +21,7 @@ from ..prompts import (
|
|
|
20
21
|
select_search_set,
|
|
21
22
|
)
|
|
22
23
|
from ..sources import pick_source
|
|
24
|
+
from ..theme import break_format
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
def pick_or_create_break(client: SlabClient, collector: str) -> BreakOut | None:
|
|
@@ -65,8 +67,10 @@ def create_break_interactive(client: SlabClient, collector: str) -> BreakOut | N
|
|
|
65
67
|
except Exception:
|
|
66
68
|
formats = []
|
|
67
69
|
break_type = select_break_type(formats)
|
|
70
|
+
# Two blasters ripped into one pile are one break: say how many, and pay for all of them below.
|
|
71
|
+
quantity = _ask_quantity()
|
|
68
72
|
break_date = ask_date("When did you open it?")
|
|
69
|
-
total_cost = ask_decimal("Total cost:")
|
|
73
|
+
total_cost = ask_decimal("Total cost (all of them):" if quantity > 1 else "Total cost:")
|
|
70
74
|
# Offer the collector's previously-used sources for arrow-key reuse (falls back to a plain
|
|
71
75
|
# text prompt on the first break, when there's nothing to reuse yet).
|
|
72
76
|
source = pick_source(client, collector)
|
|
@@ -76,19 +80,29 @@ def create_break_interactive(client: SlabClient, collector: str) -> BreakOut | N
|
|
|
76
80
|
BreakCreate(
|
|
77
81
|
set_uuid=set_choice.uuid,
|
|
78
82
|
break_type=break_type,
|
|
83
|
+
quantity=quantity,
|
|
79
84
|
break_date=break_date,
|
|
80
85
|
total_cost=total_cost,
|
|
81
86
|
source=source,
|
|
82
87
|
),
|
|
83
88
|
)
|
|
84
|
-
|
|
85
|
-
console.print(
|
|
86
|
-
|
|
87
|
-
"across them — so every card carries what it actually cost you (real profit/loss later).[/dim]"
|
|
88
|
-
)
|
|
89
|
+
per_unit = f" (${brk.cost_per_unit:.2f} each)" if brk.quantity > 1 and brk.cost_per_unit else ""
|
|
90
|
+
console.print(f"[green]Break created:[/green] {brk.break_date} · {brk.set_name} · "
|
|
91
|
+
f"{break_format(brk)} — ${brk.total_cost:.2f}{per_unit}")
|
|
89
92
|
return brk
|
|
90
93
|
|
|
91
94
|
|
|
95
|
+
def _ask_quantity() -> int:
|
|
96
|
+
"""How many of the format were opened together; Enter = 1."""
|
|
97
|
+
while True:
|
|
98
|
+
n = ask_int_optional("How many? (enter for 1)")
|
|
99
|
+
if n is None:
|
|
100
|
+
return 1
|
|
101
|
+
if 1 <= n <= 999:
|
|
102
|
+
return n
|
|
103
|
+
console.print("[yellow] Enter a count from 1 to 999.[/yellow]")
|
|
104
|
+
|
|
105
|
+
|
|
92
106
|
def cmd_break_list(args: list[str]) -> None:
|
|
93
107
|
"""`slab break list` — your breaks as a scrollable list; Enter drills into what one
|
|
94
108
|
delivered (value vs cost, the top pulls, the rarest pulls), Esc climbs back, q leaves the
|
|
@@ -78,8 +78,8 @@ def cmd_comps(args: list[str]) -> None:
|
|
|
78
78
|
def cmd_serials(args: list[str]) -> None:
|
|
79
79
|
"""Which numbered copies of a card have surfaced. Same player → set → card flow as `price`,
|
|
80
80
|
then one row per serial seen: how many collections hold it, how many times it has sold, and
|
|
81
|
-
its last sale. Sales and held copies are shown apart — the collector who bought #24
|
|
82
|
-
|
|
81
|
+
its last sale. Sales and held copies are shown apart — the collector who bought #24 is one
|
|
82
|
+
transfer seen from both sides. Unnumbered printings say so and stop."""
|
|
83
83
|
card = _pick_card(args)
|
|
84
84
|
if card is None:
|
|
85
85
|
return
|
|
@@ -32,6 +32,7 @@ from slab_schemas.timeseries import CardPriceHistory
|
|
|
32
32
|
from .browse import Page, browse
|
|
33
33
|
from .theme import (
|
|
34
34
|
bar,
|
|
35
|
+
break_format,
|
|
35
36
|
console,
|
|
36
37
|
heading,
|
|
37
38
|
kv_grid,
|
|
@@ -461,7 +462,7 @@ BREAK_COLUMNS = [
|
|
|
461
462
|
def break_cells(b) -> list[str]:
|
|
462
463
|
"""One break as its BREAK_COLUMNS cells."""
|
|
463
464
|
cpc = money(b.cost_per_card) if b.cost_per_card is not None else "—"
|
|
464
|
-
return [b.set_name or "",
|
|
465
|
+
return [b.set_name or "", break_format(b), money(b.total_cost), str(b.copy_count), cpc,
|
|
465
466
|
str(b.break_date or "—"), b.source or "—", b.uuid[:8]]
|
|
466
467
|
|
|
467
468
|
|
|
@@ -533,7 +534,7 @@ def render_break_pulls(brk, result: CollectionResult) -> None:
|
|
|
533
534
|
console.print()
|
|
534
535
|
t = Text()
|
|
535
536
|
t.append(brk.set_name or "Break", style="slab.value")
|
|
536
|
-
t.append(f" — {brk
|
|
537
|
+
t.append(f" — {break_format(brk)} · {brk.break_date or '—'}"
|
|
537
538
|
+ (f" · {brk.source}" if brk.source else ""), style="slab.dim")
|
|
538
539
|
console.print(t)
|
|
539
540
|
|
|
@@ -776,7 +777,7 @@ def render_dashboard(d: DashboardStats) -> None:
|
|
|
776
777
|
])
|
|
777
778
|
for b in d.break_stats:
|
|
778
779
|
table.add_row(str(b.break_date or "—"), b.set_name or "—",
|
|
779
|
-
|
|
780
|
+
break_format(b),
|
|
780
781
|
money(b.total_cost), str(b.cards), money(b.cost_per_card))
|
|
781
782
|
breaks = titled("Breaks", table)
|
|
782
783
|
|
|
@@ -1348,7 +1349,6 @@ def render_comps(c: CardComps) -> None:
|
|
|
1348
1349
|
("Date", {"style": "slab.dim"}),
|
|
1349
1350
|
("Price", {"justify": "right", "style": "slab.foil"}),
|
|
1350
1351
|
("Grade", {}),
|
|
1351
|
-
("Market", {"style": "slab.dim"}),
|
|
1352
1352
|
("Type", {"style": "slab.dim"}),
|
|
1353
1353
|
("Title", {}),
|
|
1354
1354
|
])
|
|
@@ -1363,10 +1363,9 @@ def render_comps(c: CardComps) -> None:
|
|
|
1363
1363
|
if getattr(comp, "grade_unconfirmed", False):
|
|
1364
1364
|
grade = f"[slab.warn]{grade}?[/]"
|
|
1365
1365
|
flagged += 1
|
|
1366
|
-
market = comp.marketplace or "—"
|
|
1367
1366
|
sale_type = comp.sale_type or "—"
|
|
1368
1367
|
title = comp.title if len(comp.title) <= 50 else comp.title[:49] + "…"
|
|
1369
|
-
table.add_row(when, price, grade,
|
|
1368
|
+
table.add_row(when, price, grade, sale_type, title)
|
|
1370
1369
|
|
|
1371
1370
|
console.print(heading("Recent Comps", f"showing {len(c.comps)} of {c.total}"))
|
|
1372
1371
|
console.print(table)
|
|
@@ -26,6 +26,7 @@ from slab_schemas.collection import (
|
|
|
26
26
|
)
|
|
27
27
|
from slab_schemas.enums import GRADE_ORDINAL, AcquisitionType, BreakType, Grade
|
|
28
28
|
|
|
29
|
+
from .theme import break_format
|
|
29
30
|
from .theme import console as _console
|
|
30
31
|
|
|
31
32
|
|
|
@@ -64,7 +65,7 @@ def _break_label(b: BreakOut) -> str:
|
|
|
64
65
|
when = b.break_date.isoformat() if b.break_date else "—"
|
|
65
66
|
src = f" · {b.source}" if b.source else ""
|
|
66
67
|
cpc = f" @ ${b.cost_per_card:.2f}/card" if b.cost_per_card else ""
|
|
67
|
-
return (f"{when} · {b.set_name} · {b
|
|
68
|
+
return (f"{when} · {b.set_name} · {break_format(b)} · ${b.total_cost:.2f}{src} · "
|
|
68
69
|
f"{b.copy_count} cards{cpc} [{b.uuid[:8]}]")
|
|
69
70
|
|
|
70
71
|
|
|
@@ -137,6 +137,14 @@ def kv_grid(rows: list[tuple[str, RenderableType]], *, label_style: str = "slab.
|
|
|
137
137
|
|
|
138
138
|
# --- Value formatters ------------------------------------------------------------------------------
|
|
139
139
|
|
|
140
|
+
def break_format(b) -> str:
|
|
141
|
+
"""A break's format with its count — 'Blaster Box', or '2× Blaster Box' when it opened two.
|
|
142
|
+
Takes a BreakOut or a dashboard BreakStat (both carry break_type and quantity)."""
|
|
143
|
+
label = (b.break_type or "").replace("_", " ").title() or "—"
|
|
144
|
+
quantity = getattr(b, "quantity", 1) or 1
|
|
145
|
+
return f"{quantity}× {label}" if quantity > 1 else label
|
|
146
|
+
|
|
147
|
+
|
|
140
148
|
def money(v) -> str:
|
|
141
149
|
"""`$1,234.56`, or an em-dash when absent."""
|
|
142
150
|
return f"${v:,.2f}" if v is not None else "—"
|
|
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
|
|
File without changes
|