slab-cli 0.9.0__tar.gz → 0.10.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.
Files changed (34) hide show
  1. {slab_cli-0.9.0 → slab_cli-0.10.0}/PKG-INFO +1 -1
  2. {slab_cli-0.9.0 → slab_cli-0.10.0}/pyproject.toml +1 -1
  3. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/breaks.py +8 -3
  4. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/display.py +5 -4
  5. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/prompts.py +11 -2
  6. {slab_cli-0.9.0 → slab_cli-0.10.0}/README.md +0 -0
  7. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/__init__.py +0 -0
  8. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/banner.py +0 -0
  9. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/browse.py +0 -0
  10. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/client.py +0 -0
  11. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/__init__.py +0 -0
  12. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/catalog.py +0 -0
  13. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/collection.py +0 -0
  14. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/custom_sets.py +0 -0
  15. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/export.py +0 -0
  16. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/lots.py +0 -0
  17. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/pricing.py +0 -0
  18. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/registry.py +0 -0
  19. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/setup.py +0 -0
  20. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/commands/update.py +0 -0
  21. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/config.py +0 -0
  22. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/context.py +0 -0
  23. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/flags.py +0 -0
  24. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/help.py +0 -0
  25. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/main.py +0 -0
  26. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/paging.py +0 -0
  27. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/picker.py +0 -0
  28. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/platforms/__init__.py +0 -0
  29. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/platforms/base.py +0 -0
  30. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/platforms/posix.py +0 -0
  31. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/platforms/windows.py +0 -0
  32. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/sources.py +0 -0
  33. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/theme.py +0 -0
  34. {slab_cli-0.9.0 → slab_cli-0.10.0}/src/slab_cli/updates.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: slab-cli
3
- Version: 0.9.0
3
+ Version: 0.10.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
6
  Requires-Dist: slab-schemas>=0.1.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "slab-cli"
3
- version = "0.9.0"
3
+ version = "0.10.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"}]
@@ -6,7 +6,6 @@ from __future__ import annotations
6
6
 
7
7
  from slab_schemas.cards import SetSearchQuery
8
8
  from slab_schemas.collection import BreakCreate, BreakOut, BreakSearchQuery, CollectionSearchQuery
9
- from slab_schemas.enums import BreakType
10
9
 
11
10
  from ..client import SlabClient
12
11
  from ..context import ctx
@@ -59,7 +58,13 @@ def create_break_interactive(client: SlabClient, collector: str) -> BreakOut | N
59
58
  if set_choice is None:
60
59
  return None
61
60
 
62
- break_type = select_break_type()
61
+ # Offer the formats this set actually comes in (its sealed SKUs); a set with no SKUs — or a
62
+ # failed lookup — falls back to the generic picker. Never let the extra lookup kill the flow.
63
+ try:
64
+ formats = [p.format.value for p in client.get_set_sealed(set_choice.uuid)]
65
+ except Exception:
66
+ formats = []
67
+ break_type = select_break_type(formats)
63
68
  break_date = ask_date("When did you open it?")
64
69
  total_cost = ask_decimal("Total cost:")
65
70
  # Offer the collector's previously-used sources for arrow-key reuse (falls back to a plain
@@ -70,7 +75,7 @@ def create_break_interactive(client: SlabClient, collector: str) -> BreakOut | N
70
75
  collector,
71
76
  BreakCreate(
72
77
  set_uuid=set_choice.uuid,
73
- break_type=BreakType(break_type),
78
+ break_type=break_type,
74
79
  break_date=break_date,
75
80
  total_cost=total_cost,
76
81
  source=source,
@@ -261,7 +261,7 @@ BREAK_COLUMNS = [
261
261
  def break_cells(b) -> list[str]:
262
262
  """One break as its BREAK_COLUMNS cells."""
263
263
  cpc = money(b.cost_per_card) if b.cost_per_card is not None else "—"
264
- return [b.set_name or "", b.break_type, money(b.total_cost), str(b.copy_count), cpc,
264
+ return [b.set_name or "", _format_label(b.break_type), money(b.total_cost), str(b.copy_count), cpc,
265
265
  str(b.break_date or "—"), b.source or "—", b.uuid[:8]]
266
266
 
267
267
 
@@ -314,7 +314,7 @@ def render_break_pulls(brk, result: CollectionResult) -> None:
314
314
  console.print()
315
315
  t = Text()
316
316
  t.append(brk.set_name or "Break", style="slab.value")
317
- t.append(f" — {brk.break_type} · {brk.break_date or '—'}"
317
+ t.append(f" — {brk.break_type.replace('_', ' ')} · {brk.break_date or '—'}"
318
318
  + (f" · {brk.source}" if brk.source else ""), style="slab.dim")
319
319
  console.print(t)
320
320
 
@@ -555,7 +555,8 @@ def render_dashboard(d: DashboardStats) -> None:
555
555
  ("$/card", {"justify": "right", "style": "slab.dim"}),
556
556
  ])
557
557
  for b in d.break_stats:
558
- table.add_row(str(b.break_date or "—"), b.set_name or "—", b.break_type or "—",
558
+ table.add_row(str(b.break_date or "—"), b.set_name or "—",
559
+ _format_label(b.break_type) if b.break_type else "—",
559
560
  money(b.total_cost), str(b.cards), money(b.cost_per_card))
560
561
  breaks = titled("Breaks", table)
561
562
 
@@ -1073,7 +1074,7 @@ def _render_most_valuable_break(mvb: dict | None) -> None:
1073
1074
  date_str = f" · {mvb['break_date']}" if mvb.get("break_date") else ""
1074
1075
  title = Text()
1075
1076
  title.append(mvb["set_name"], style="slab.value")
1076
- title.append(f" {mvb['break_type']}{date_str}", style="slab.dim")
1077
+ title.append(f" {mvb['break_type'].replace('_', ' ')}{date_str}", style="slab.dim")
1077
1078
 
1078
1079
  g = mvb["gain"]
1079
1080
  verdict = "paid off" if g >= 0 else "underwater"
@@ -62,7 +62,7 @@ def _break_label(b: BreakOut) -> str:
62
62
  when = b.break_date.isoformat() if b.break_date else "—"
63
63
  src = f" · {b.source}" if b.source else ""
64
64
  cpc = f" @ ${b.cost_per_card:.2f}/card" if b.cost_per_card else ""
65
- return (f"{when} · {b.set_name} · {b.break_type} · ${b.total_cost:.2f}{src} · "
65
+ return (f"{when} · {b.set_name} · {b.break_type.replace('_', ' ')} · ${b.total_cost:.2f}{src} · "
66
66
  f"{b.copy_count} cards{cpc} [{b.uuid[:8]}]")
67
67
 
68
68
 
@@ -388,7 +388,16 @@ def select_acquisition_type() -> str:
388
388
  return inquirer.select(message="How did you acquire this card?", choices=choices).execute()
389
389
 
390
390
 
391
- def select_break_type() -> str:
391
+ def select_break_type(formats: list[str] | None = None) -> str:
392
+ """What was opened. When the set's sealed SKUs are known, offer those formats first (the
393
+ things actually purchasable for THIS set) with an Other… escape to the generic list; a set
394
+ with no SKUs goes straight to the generic pack/box/case/other."""
395
+ if formats:
396
+ choices = [Choice(value=f, name=f.replace("_", " ").title()) for f in formats]
397
+ choices.append(Choice(value=None, name="Other…"))
398
+ picked = inquirer.select(message="What did you open?", choices=choices).execute()
399
+ if picked is not None:
400
+ return picked
392
401
  choices = [Choice(value=t.value, name=_enum_label(t, _BREAK_TYPE_LABELS)) for t in BreakType]
393
402
  return inquirer.select(message="What did you open?", choices=choices).execute()
394
403
 
File without changes
File without changes
File without changes