slab-cli 0.27.2__tar.gz → 0.28.1__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.27.2 → slab_cli-0.28.1}/PKG-INFO +2 -2
- {slab_cli-0.27.2 → slab_cli-0.28.1}/pyproject.toml +2 -2
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/client.py +2 -9
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/pricing.py +13 -20
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/registry.py +2 -2
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/display.py +19 -18
- {slab_cli-0.27.2 → slab_cli-0.28.1}/README.md +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/__init__.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/banner.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/browse.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/__init__.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/breaks.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/catalog.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/collection.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/custom_sets.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/export.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/lots.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/setup.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/commands/update.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/config.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/context.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/flags.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/help.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/main.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/nav.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/paging.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/picker.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/platforms/__init__.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/platforms/base.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/platforms/posix.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/platforms/windows.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/prompts.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/sources.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/src/slab_cli/theme.py +0 -0
- {slab_cli-0.27.2 → slab_cli-0.28.1}/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.28.1
|
|
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.57.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.28.1"
|
|
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.57.0", # grading desk without a fee
|
|
16
16
|
"httpx>=0.27",
|
|
17
17
|
"rich>=13.0",
|
|
18
18
|
"InquirerPy>=0.3",
|
|
@@ -132,24 +132,17 @@ class SlabClient:
|
|
|
132
132
|
resp = self._request("GET", f"/cards/{card_uuid}/comps", params=params)
|
|
133
133
|
return CardComps.model_validate(resp.json())
|
|
134
134
|
|
|
135
|
-
def get_grading_desk(
|
|
136
|
-
self, card_uuid: str, fee: float | None = None, company: str | None = None
|
|
137
|
-
) -> GradingDesk:
|
|
135
|
+
def get_grading_desk(self, card_uuid: str, company: str | None = None) -> GradingDesk:
|
|
138
136
|
params: dict[str, str] = {}
|
|
139
|
-
if fee is not None:
|
|
140
|
-
params["fee"] = str(fee)
|
|
141
137
|
if company:
|
|
142
138
|
params["company"] = company
|
|
143
139
|
resp = self._request("GET", f"/cards/{card_uuid}/grading-desk", params=params)
|
|
144
140
|
return GradingDesk.model_validate(resp.json())
|
|
145
141
|
|
|
146
142
|
def get_collection_grading_desk(
|
|
147
|
-
self, collector_uuid: str,
|
|
148
|
-
company: str | None = None, limit: int = 50,
|
|
143
|
+
self, collector_uuid: str, company: str | None = None, limit: int = 50,
|
|
149
144
|
) -> CollectionGradingDesk:
|
|
150
145
|
params: dict[str, str] = {"limit": str(limit)}
|
|
151
|
-
if fee is not None:
|
|
152
|
-
params["fee"] = str(fee)
|
|
153
146
|
if company:
|
|
154
147
|
params["company"] = company
|
|
155
148
|
resp = self._request(
|
|
@@ -86,48 +86,41 @@ def cmd_serials(args: list[str]) -> None:
|
|
|
86
86
|
render_serials(ctx.client.get_card_serials(card.uuid))
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
def _split_desk_flags(args: list[str]) -> tuple[list[str],
|
|
90
|
-
"""Pull `--
|
|
91
|
-
|
|
92
|
-
silently pricing off the default."""
|
|
89
|
+
def _split_desk_flags(args: list[str]) -> tuple[list[str], str | None]:
|
|
90
|
+
"""Pull `--company <name>` out of a grading query. Hand-rolled (the shared flag grammar is
|
|
91
|
+
search-specific)."""
|
|
93
92
|
rest: list[str] = []
|
|
94
|
-
fee: float | None = None
|
|
95
93
|
company: str | None = None
|
|
96
94
|
i = 0
|
|
97
95
|
while i < len(args):
|
|
98
96
|
a = args[i]
|
|
99
|
-
if a == "--
|
|
100
|
-
try:
|
|
101
|
-
fee = float(args[i + 1].lstrip("$"))
|
|
102
|
-
except ValueError:
|
|
103
|
-
raise SystemExit(f"--fee expects a number, got {args[i + 1]!r}")
|
|
104
|
-
i += 2
|
|
105
|
-
elif a == "--company" and i + 1 < len(args):
|
|
97
|
+
if a == "--company" and i + 1 < len(args):
|
|
106
98
|
company = args[i + 1]
|
|
107
99
|
i += 2
|
|
108
100
|
else:
|
|
109
101
|
rest.append(a)
|
|
110
102
|
i += 1
|
|
111
|
-
return rest,
|
|
103
|
+
return rest, company
|
|
112
104
|
|
|
113
105
|
|
|
114
106
|
def cmd_grade(args: list[str]) -> None:
|
|
115
107
|
"""The grading math for a card. Same player → set → card flow as `price`, then the grading
|
|
116
|
-
desk: what each grade
|
|
117
|
-
the
|
|
118
|
-
|
|
108
|
+
desk: what each grade is worth over the raw card and where break-even sits — sale prices
|
|
109
|
+
alone, before fees; the data to decide with, the decision is yours. `--company SGC` switches
|
|
110
|
+
grader."""
|
|
111
|
+
args, company = _split_desk_flags(args)
|
|
119
112
|
card = _pick_card(args)
|
|
120
113
|
if card is None:
|
|
121
114
|
return
|
|
122
|
-
render_grading_desk(ctx.client.get_grading_desk(card.uuid,
|
|
115
|
+
render_grading_desk(ctx.client.get_grading_desk(card.uuid, company=company))
|
|
123
116
|
|
|
124
117
|
|
|
125
118
|
def cmd_grade_sweep(args: list[str]) -> None:
|
|
126
119
|
"""The grading math across your raw cards, biggest upside first — where the per-card
|
|
127
|
-
break-even bars become batch odds.
|
|
128
|
-
args,
|
|
120
|
+
break-even bars become batch odds. Sale prices alone, before fees."""
|
|
121
|
+
args, company = _split_desk_flags(args)
|
|
129
122
|
render_collection_grading_desk(
|
|
130
|
-
ctx.client.get_collection_grading_desk(ctx.collector,
|
|
123
|
+
ctx.client.get_collection_grading_desk(ctx.collector, company=company)
|
|
131
124
|
)
|
|
132
125
|
|
|
133
126
|
|
|
@@ -59,7 +59,7 @@ GROUPS: list[Group] = [
|
|
|
59
59
|
Command("search", "Search the catalog (player, set, team…)", catalog.cmd_search, "[query] [flags]"),
|
|
60
60
|
Command("parallels", "Every parallel (the rainbow) of a card", catalog.cmd_rainbow, "<query>"),
|
|
61
61
|
Command("price", "Market price + 7d/30d trend", pricing.cmd_price, "<query>"),
|
|
62
|
-
Command("grade", "The grading math: payoffs per grade + break-even", pricing.cmd_grade, "<query> [--
|
|
62
|
+
Command("grade", "The grading math: payoffs per grade + break-even", pricing.cmd_grade, "<query> [--company NAME]"),
|
|
63
63
|
Command("comps", "Recent raw sales behind the price", pricing.cmd_comps, "<query>"),
|
|
64
64
|
Command("serials", "Which numbered copies have surfaced (sales + collections)", pricing.cmd_serials, "<query>"),
|
|
65
65
|
Command("history", "Price history over time", pricing.cmd_history, "<query>"),
|
|
@@ -81,7 +81,7 @@ GROUPS: list[Group] = [
|
|
|
81
81
|
Command("export", "Export a set to a printable checklist", export.cmd_export),
|
|
82
82
|
Command("dashboard", "Overview: counts, value, composition", collection.cmd_dashboard),
|
|
83
83
|
Command("portfolio", "Portfolio: cost basis vs FMV, by set, top movers", pricing.cmd_portfolio),
|
|
84
|
-
Command("grade", "Grading math for every raw copy, best upside first", pricing.cmd_grade_sweep, "[--
|
|
84
|
+
Command("grade", "Grading math for every raw copy, best upside first", pricing.cmd_grade_sweep, "[--company NAME]"),
|
|
85
85
|
]),
|
|
86
86
|
Group("break", "case / box breaks", [
|
|
87
87
|
Command("list", "Your breaks — pick one to see value vs cost + top pulls", breaks.cmd_break_list),
|
|
@@ -1410,7 +1410,7 @@ def _desk_reading_line(d: GradingDesk) -> str:
|
|
|
1410
1410
|
return (grade_key or "").replace("-", " ")
|
|
1411
1411
|
|
|
1412
1412
|
def outcome(grade_key: str | None) -> str | None:
|
|
1413
|
-
"""`a PSA 10
|
|
1413
|
+
"""`a PSA 10 is $358 over raw` / `a PSA 9 is $122 under` — whole dollars when estimated."""
|
|
1414
1414
|
lane = next((l for l in d.lanes if l.grade_key == grade_key), None)
|
|
1415
1415
|
if lane is None or lane.payoff is None:
|
|
1416
1416
|
return None
|
|
@@ -1420,18 +1420,18 @@ def _desk_reading_line(d: GradingDesk) -> str:
|
|
|
1420
1420
|
else:
|
|
1421
1421
|
n = float(lane.payoff)
|
|
1422
1422
|
amount = money(abs(n))
|
|
1423
|
-
return (f"a {name(grade_key)} [slab.loss]
|
|
1424
|
-
else f"a {name(grade_key)} [slab.gain]
|
|
1423
|
+
return (f"a {name(grade_key)} [slab.loss]is {amount} under raw[/]" if n < 0
|
|
1424
|
+
else f"a {name(grade_key)} [slab.gain]is {amount} over raw[/]")
|
|
1425
1425
|
|
|
1426
1426
|
gem = next((l for l in d.lanes if l.grade_key.startswith(f"{d.grading_company}-")), None)
|
|
1427
1427
|
if d.break_even == BreakEvenRegion.not_enough_data:
|
|
1428
1428
|
return "[slab.dim]No graded sales to compare yet — nobody has sold a graded copy of this card recently.[/]"
|
|
1429
1429
|
if d.break_even == BreakEvenRegion.pays_at_no_grade:
|
|
1430
1430
|
top = outcome(gem.grade_key) if gem else None
|
|
1431
|
-
return "[slab.loss]No grade
|
|
1431
|
+
return "[slab.loss]No grade sells above raw[/]" + (f" — even {top}." if top else ".")
|
|
1432
1432
|
if d.break_even == BreakEvenRegion.pays_at_any_grade:
|
|
1433
1433
|
miss = None if d.miss_grade == "raw value" else outcome(d.miss_grade)
|
|
1434
|
-
return "[slab.gain]Every grade
|
|
1434
|
+
return "[slab.gain]Every grade sells above raw[/]" + (f" — even {miss}." if miss else ".")
|
|
1435
1435
|
head = (f"Grading breaks even at a {d.ten_confidence_needed:.0%} chance of a {name(gem.grade_key)}"
|
|
1436
1436
|
if gem and d.ten_confidence_needed is not None else "Depends on the grade")
|
|
1437
1437
|
parts = [outcome(gem.grade_key) if gem else None,
|
|
@@ -1456,17 +1456,15 @@ def render_grading_desk(d: GradingDesk) -> None:
|
|
|
1456
1456
|
|
|
1457
1457
|
console.print(
|
|
1458
1458
|
f"\n Raw value: [slab.value]{money(d.raw.fair_market_value)}[/] "
|
|
1459
|
-
f"[slab.dim](from {d.raw.sample_size} sales) ·
|
|
1460
|
-
f"
|
|
1461
|
-
+ (" — pass --fee to use your rate" if d.fee_source == "default" else " (your rate)")
|
|
1462
|
-
+ "[/]"
|
|
1459
|
+
f"[slab.dim](from {d.raw.sample_size} sales) · every number below is sale prices "
|
|
1460
|
+
f"alone — subtract what you pay to grade[/]"
|
|
1463
1461
|
)
|
|
1464
1462
|
|
|
1465
1463
|
if d.lanes:
|
|
1466
1464
|
table = slab_table([
|
|
1467
1465
|
("If it grades", {}),
|
|
1468
1466
|
("Sells for", {"justify": "right", "style": "slab.foil"}),
|
|
1469
|
-
("
|
|
1467
|
+
("Over raw", {"justify": "right"}),
|
|
1470
1468
|
("Sales", {"justify": "right", "style": "slab.dim"}),
|
|
1471
1469
|
("Sells", {"style": "slab.dim"}),
|
|
1472
1470
|
])
|
|
@@ -1483,7 +1481,7 @@ def render_grading_desk(d: GradingDesk) -> None:
|
|
|
1483
1481
|
n = f"{l.sample_size}!" if l.low_confidence else str(l.sample_size)
|
|
1484
1482
|
table.add_row(l.grade_key, money(l.fair_market_value), signed_money(l.payoff), n,
|
|
1485
1483
|
_liquidity_text(l.liquidity))
|
|
1486
|
-
console.print(heading("Payoff per Grade", "
|
|
1484
|
+
console.print(heading("Payoff per Grade", "vs staying raw, before fees"))
|
|
1487
1485
|
console.print(table)
|
|
1488
1486
|
if any(l.low_confidence for l in d.lanes):
|
|
1489
1487
|
console.print(" [slab.dim]! = priced off very few sales — an anecdote, "
|
|
@@ -1534,14 +1532,17 @@ def render_collection_grading_desk(sweep: CollectionGradingDesk) -> None:
|
|
|
1534
1532
|
table = slab_table([
|
|
1535
1533
|
("Card", {"no_wrap": False}),
|
|
1536
1534
|
("Raw", {"justify": "right", "style": "slab.dim"}),
|
|
1537
|
-
("Gem
|
|
1538
|
-
("Miss
|
|
1535
|
+
("Gem vs raw", {"justify": "right"}),
|
|
1536
|
+
("Miss vs raw", {"justify": "right"}),
|
|
1539
1537
|
("Break-even", {"justify": "right", "style": "slab.foil"}),
|
|
1540
1538
|
("Qty", {"justify": "right", "style": "slab.dim"}),
|
|
1541
1539
|
])
|
|
1540
|
+
# not_enough_data rows are cards with graded sales but no gem market for the chosen company
|
|
1541
|
+
# (only an 8, or only BGS): prices to show, no bar to compute.
|
|
1542
1542
|
BREAK_EVEN_TXT = {
|
|
1543
1543
|
BreakEvenRegion.pays_at_any_grade: "[slab.gain]any grade[/]",
|
|
1544
1544
|
BreakEvenRegion.pays_at_no_grade: "[slab.loss]no grade[/]",
|
|
1545
|
+
BreakEvenRegion.not_enough_data: "[slab.dim]—[/]",
|
|
1545
1546
|
}
|
|
1546
1547
|
for e in sweep.entries:
|
|
1547
1548
|
d = e.desk
|
|
@@ -1564,11 +1565,11 @@ def render_collection_grading_desk(sweep: CollectionGradingDesk) -> None:
|
|
|
1564
1565
|
be + thin, str(e.quantity),
|
|
1565
1566
|
)
|
|
1566
1567
|
console.print(table)
|
|
1567
|
-
console.print(
|
|
1568
|
-
|
|
1569
|
-
"
|
|
1570
|
-
"even a miss
|
|
1571
|
-
"corners; slab can't — the call is yours. ! = rests on very few sales.[/]")
|
|
1568
|
+
console.print(" [slab.dim]Sale prices alone — no grading fee is included; subtract what you "
|
|
1569
|
+
"pay. Break-even = the chance of a gem at which grading and staying raw are "
|
|
1570
|
+
"worth the same — below it grading is worth less, above it more; 'any grade' = "
|
|
1571
|
+
"even a miss sells above raw, 'no grade' = even a gem doesn't. You can see each "
|
|
1572
|
+
"card's corners; slab can't — the call is yours. ! = rests on very few sales.[/]")
|
|
1572
1573
|
console.print()
|
|
1573
1574
|
|
|
1574
1575
|
|
|
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
|
|
File without changes
|