slab-cli 0.27.0__tar.gz → 0.27.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.
- {slab_cli-0.27.0 → slab_cli-0.27.2}/PKG-INFO +2 -2
- {slab_cli-0.27.0 → slab_cli-0.27.2}/pyproject.toml +2 -2
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/display.py +67 -53
- {slab_cli-0.27.0 → slab_cli-0.27.2}/README.md +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/__init__.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/banner.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/browse.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/client.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/__init__.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/breaks.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/catalog.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/collection.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/custom_sets.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/export.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/lots.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/pricing.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/registry.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/setup.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/commands/update.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/config.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/context.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/flags.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/help.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/main.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/nav.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/paging.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/picker.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/platforms/__init__.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/platforms/base.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/platforms/posix.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/platforms/windows.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/prompts.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/sources.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/src/slab_cli/theme.py +0 -0
- {slab_cli-0.27.0 → slab_cli-0.27.2}/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.27.
|
|
3
|
+
Version: 0.27.2
|
|
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.54.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.27.
|
|
3
|
+
version = "0.27.2"
|
|
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.54.0", # metrics registry: served momentum/trend labels
|
|
16
16
|
"httpx>=0.27",
|
|
17
17
|
"rich>=13.0",
|
|
18
18
|
"InquirerPy>=0.3",
|
|
@@ -1379,53 +1379,65 @@ def _whole_dollars(v) -> str:
|
|
|
1379
1379
|
return f"${float(v):,.0f}"
|
|
1380
1380
|
|
|
1381
1381
|
|
|
1382
|
-
def
|
|
1383
|
-
"""
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1382
|
+
def _signed_whole(v) -> str:
|
|
1383
|
+
"""`+$358` / `−$122`, colored — a gain or loss built on an estimate, whole dollars."""
|
|
1384
|
+
if v is None:
|
|
1385
|
+
return "[slab.dim]—[/]"
|
|
1386
|
+
n = round(float(v))
|
|
1387
|
+
return f"[{'slab.gain' if n >= 0 else 'slab.loss'}]{'+' if n >= 0 else '−'}${abs(n):,}[/]"
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
def estimate_caption(estimates) -> str:
|
|
1391
|
+
"""One line: which grades are estimated, and from what. Same words as the site's
|
|
1392
|
+
`estimateCaption`."""
|
|
1393
|
+
grades = [e.grade_key.replace("-", " ") for e in estimates]
|
|
1394
|
+
names = grades[0] + "".join(f" or {g.split(' ', 1)[-1]}" for g in grades[1:])
|
|
1395
|
+
those = "those prices are" if len(grades) > 1 else "that price is"
|
|
1396
|
+
return f"No {names} of this card has sold yet, so {those} estimated from similar cards."
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
def estimate_lines(e) -> list[str]:
|
|
1400
|
+
"""How an estimate was made, as the API's own plain lines with this card's numbers (an older
|
|
1401
|
+
response without them falls back to the cards it rests on). Same as the site's
|
|
1402
|
+
`estimateLines`."""
|
|
1403
|
+
return list(e.explanation) or [f"Cards like this: {e.basis_label}."]
|
|
1393
1404
|
|
|
1394
1405
|
|
|
1395
1406
|
def _desk_reading_line(d: GradingDesk) -> str:
|
|
1396
|
-
"""Where the math lands, as
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
+
"""Where the math lands: a headline and the outcomes, as DATA — never an instruction (grading
|
|
1408
|
+
is subjective and the user is holding the card). Same words as the site's break-even banner."""
|
|
1409
|
+
def name(grade_key: str | None) -> str:
|
|
1410
|
+
return (grade_key or "").replace("-", " ")
|
|
1411
|
+
|
|
1412
|
+
def outcome(grade_key: str | None) -> str | None:
|
|
1413
|
+
"""`a PSA 10 nets +$358` / `a PSA 9 loses $122` — whole dollars when the grade is estimated."""
|
|
1414
|
+
lane = next((l for l in d.lanes if l.grade_key == grade_key), None)
|
|
1415
|
+
if lane is None or lane.payoff is None:
|
|
1416
|
+
return None
|
|
1417
|
+
if lane.estimate:
|
|
1418
|
+
n = round(float(lane.payoff))
|
|
1419
|
+
amount = f"${abs(n):,}"
|
|
1420
|
+
else:
|
|
1421
|
+
n = float(lane.payoff)
|
|
1422
|
+
amount = money(abs(n))
|
|
1423
|
+
return (f"a {name(grade_key)} [slab.loss]loses {amount}[/]" if n < 0
|
|
1424
|
+
else f"a {name(grade_key)} [slab.gain]nets +{amount}[/]")
|
|
1407
1425
|
|
|
1408
1426
|
gem = next((l for l in d.lanes if l.grade_key.startswith(f"{d.grading_company}-")), None)
|
|
1409
1427
|
if d.break_even == BreakEvenRegion.not_enough_data:
|
|
1410
|
-
return
|
|
1411
|
-
"card recently. Not a no; an honest shrug.[/]")
|
|
1428
|
+
return "[slab.dim]No graded sales to compare yet — nobody has sold a graded copy of this card recently.[/]"
|
|
1412
1429
|
if d.break_even == BreakEvenRegion.pays_at_no_grade:
|
|
1413
|
-
top =
|
|
1414
|
-
return
|
|
1415
|
-
f"after the {money(d.fee)} fee.")
|
|
1416
|
-
miss_pay = payoff_of(d.miss_grade)
|
|
1430
|
+
top = outcome(gem.grade_key) if gem else None
|
|
1431
|
+
return "[slab.loss]No grade covers the fee[/]" + (f" — even {top}." if top else ".")
|
|
1417
1432
|
if d.break_even == BreakEvenRegion.pays_at_any_grade:
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
return (f"[slab.foil]Depends on the grade[/] — {gem_txt}, {miss_txt}. Break-even sits at "
|
|
1427
|
-
f"{pct}: below that chance of a gem, grading loses; above it, grading wins. "
|
|
1428
|
-
f"You can see the card; that read is yours.")
|
|
1433
|
+
miss = None if d.miss_grade == "raw value" else outcome(d.miss_grade)
|
|
1434
|
+
return "[slab.gain]Every grade pays[/]" + (f" — even {miss}." if miss else ".")
|
|
1435
|
+
head = (f"Grading breaks even at a {d.ten_confidence_needed:.0%} chance of a {name(gem.grade_key)}"
|
|
1436
|
+
if gem and d.ten_confidence_needed is not None else "Depends on the grade")
|
|
1437
|
+
parts = [outcome(gem.grade_key) if gem else None,
|
|
1438
|
+
"a miss holds about raw value" if d.miss_grade == "raw value" else outcome(d.miss_grade)]
|
|
1439
|
+
tail = "; ".join(p for p in parts if p)
|
|
1440
|
+
return f"[slab.foil]{head}[/]" + (f" — {tail}." if tail else ".")
|
|
1429
1441
|
|
|
1430
1442
|
|
|
1431
1443
|
def render_grading_desk(d: GradingDesk) -> None:
|
|
@@ -1460,10 +1472,13 @@ def render_grading_desk(d: GradingDesk) -> None:
|
|
|
1460
1472
|
])
|
|
1461
1473
|
for l in d.lanes:
|
|
1462
1474
|
if l.estimate:
|
|
1463
|
-
# An estimate, not sales: tagged,
|
|
1464
|
-
|
|
1465
|
-
table.add_row(
|
|
1466
|
-
|
|
1475
|
+
# An estimate, not sales: tagged, whole dollars with its range — explained below.
|
|
1476
|
+
e = l.estimate
|
|
1477
|
+
table.add_row(
|
|
1478
|
+
f"{l.grade_key} [slab.warn]est.[/]",
|
|
1479
|
+
f"{_whole_dollars(e.fair_market_value)} [slab.dim]range "
|
|
1480
|
+
f"{_whole_dollars(e.range_low)}–{_whole_dollars(e.range_high)}[/]",
|
|
1481
|
+
_signed_whole(l.payoff), "—", "")
|
|
1467
1482
|
continue
|
|
1468
1483
|
n = f"{l.sample_size}!" if l.low_confidence else str(l.sample_size)
|
|
1469
1484
|
table.add_row(l.grade_key, money(l.fair_market_value), signed_money(l.payoff), n,
|
|
@@ -1475,13 +1490,12 @@ def render_grading_desk(d: GradingDesk) -> None:
|
|
|
1475
1490
|
"not a market.[/]")
|
|
1476
1491
|
estimates = [l.estimate for l in d.lanes if l.estimate]
|
|
1477
1492
|
if estimates:
|
|
1478
|
-
|
|
1479
|
-
summary = info.summary if info else "estimated from similar cards — not a sale."
|
|
1480
|
-
console.print(f" [slab.warn]est.[/] [slab.dim]= {summary}[/]")
|
|
1493
|
+
console.print(f" [slab.warn]est.[/] {estimate_caption(estimates)}")
|
|
1481
1494
|
for e in estimates:
|
|
1482
|
-
console.print(f" [slab.
|
|
1483
|
-
|
|
1484
|
-
|
|
1495
|
+
console.print(f" [slab.value]{e.grade_key.replace('-', ' ')} ≈ "
|
|
1496
|
+
f"{_whole_dollars(e.fair_market_value)}[/]")
|
|
1497
|
+
for line in estimate_lines(e):
|
|
1498
|
+
console.print(f" [slab.dim]{line}[/]")
|
|
1485
1499
|
if any(l.liquidity for l in d.lanes):
|
|
1486
1500
|
console.print(" [slab.dim]Sells = how often that grade actually trades — a payoff "
|
|
1487
1501
|
"at a grade that sells twice a year is a longer wait than one that "
|
|
@@ -1492,15 +1506,15 @@ def render_grading_desk(d: GradingDesk) -> None:
|
|
|
1492
1506
|
if d.break_even in (BreakEvenRegion.pays_at_any_grade, BreakEvenRegion.depends_on_grade) \
|
|
1493
1507
|
and d.ten_confidence_needed_bad_day is not None and d.bad_day_grade:
|
|
1494
1508
|
console.print(
|
|
1495
|
-
f" [slab.dim]
|
|
1496
|
-
f"
|
|
1509
|
+
f" [slab.dim]If a miss comes back {d.bad_day_grade.replace('-', ' ')}: "
|
|
1510
|
+
f"{d.ten_confidence_needed_bad_day:.0%}.[/]"
|
|
1497
1511
|
)
|
|
1498
1512
|
if d.thin_data:
|
|
1499
1513
|
console.print(" [slab.warn]Thin data[/][slab.dim] — part of this reading rests on "
|
|
1500
1514
|
"1-2 sales. Treat it as a hint, not a market reading.[/]")
|
|
1501
1515
|
if d.estimated:
|
|
1502
|
-
console.print(" [slab.warn]
|
|
1503
|
-
"
|
|
1516
|
+
console.print(" [slab.warn]Uses estimates[/][slab.dim] — a grade above has never sold for "
|
|
1517
|
+
"this card, so this reading is a ballpark too.[/]")
|
|
1504
1518
|
console.print()
|
|
1505
1519
|
|
|
1506
1520
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|