slab-cli 0.33.0__tar.gz → 0.33.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.33.0 → slab_cli-0.33.2}/PKG-INFO +6 -3
- {slab_cli-0.33.0 → slab_cli-0.33.2}/README.md +4 -2
- {slab_cli-0.33.0 → slab_cli-0.33.2}/pyproject.toml +4 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/banner.py +1 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/client.py +1 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/catalog.py +1 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/setup.py +3 -3
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/context.py +1 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/display.py +3 -3
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/help.py +1 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/main.py +3 -3
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/prompts.py +1 -1
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/theme.py +7 -7
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/__init__.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/browse.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/__init__.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/breaks.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/collection.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/custom_sets.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/export.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/lots.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/pricing.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/registry.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/commands/update.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/config.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/flags.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/nav.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/paging.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/picker.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/platforms/__init__.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/platforms/base.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/platforms/posix.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/platforms/windows.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/src/slab_cli/sources.py +0 -0
- {slab_cli-0.33.0 → slab_cli-0.33.2}/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.33.
|
|
3
|
+
Version: 0.33.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
6
|
Requires-Dist: slab-schemas>=0.100.0
|
|
@@ -8,6 +8,7 @@ Requires-Dist: httpx>=0.27
|
|
|
8
8
|
Requires-Dist: rich>=13.0
|
|
9
9
|
Requires-Dist: inquirerpy>=0.3
|
|
10
10
|
Requires-Python: >=3.13
|
|
11
|
+
Project-URL: Homepage, https://collection.slab.dev-jeb.com
|
|
11
12
|
Description-Content-Type: text/markdown
|
|
12
13
|
|
|
13
14
|
# slab-cli
|
|
@@ -23,8 +24,10 @@ This installs the `slab` command.
|
|
|
23
24
|
|
|
24
25
|
## Setup
|
|
25
26
|
|
|
26
|
-
The CLI talks to the hosted slab API. You need an **API key
|
|
27
|
-
[slab
|
|
27
|
+
The CLI talks to the hosted slab API. You need an **API key**: sign in at
|
|
28
|
+
[collection.slab.dev-jeb.com](https://collection.slab.dev-jeb.com) and create one under your
|
|
29
|
+
account's [API keys](https://collection.slab.dev-jeb.com/account/api-keys) (account menu → Manage
|
|
30
|
+
account → API keys). Then:
|
|
28
31
|
|
|
29
32
|
```bash
|
|
30
33
|
export SLAB_API_KEY=sk_live_... # your key (required)
|
|
@@ -11,8 +11,10 @@ This installs the `slab` command.
|
|
|
11
11
|
|
|
12
12
|
## Setup
|
|
13
13
|
|
|
14
|
-
The CLI talks to the hosted slab API. You need an **API key
|
|
15
|
-
[slab
|
|
14
|
+
The CLI talks to the hosted slab API. You need an **API key**: sign in at
|
|
15
|
+
[collection.slab.dev-jeb.com](https://collection.slab.dev-jeb.com) and create one under your
|
|
16
|
+
account's [API keys](https://collection.slab.dev-jeb.com/account/api-keys) (account menu → Manage
|
|
17
|
+
account → API keys). Then:
|
|
16
18
|
|
|
17
19
|
```bash
|
|
18
20
|
export SLAB_API_KEY=sk_live_... # your key (required)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "slab-cli"
|
|
3
|
-
version = "0.33.
|
|
3
|
+
version = "0.33.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"}]
|
|
@@ -14,6 +14,9 @@ dependencies = [
|
|
|
14
14
|
"InquirerPy>=0.3",
|
|
15
15
|
]
|
|
16
16
|
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://collection.slab.dev-jeb.com"
|
|
19
|
+
|
|
17
20
|
[dependency-groups]
|
|
18
21
|
dev = ["pytest>=8.0"]
|
|
19
22
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A rounded foil-edged case (the same card silhouette every panel in the CLI uses), a grade label
|
|
4
4
|
across the top — because obviously this CLI grades a perfect GEM MT 10 — and the SLAB wordmark
|
|
5
|
-
printed in full gold foil: the letter faces run a top-to-bottom gradient between the
|
|
5
|
+
printed in full gold foil: the letter faces run a top-to-bottom gradient between the site's two
|
|
6
6
|
foil tokens (bright gold catching the light, fading toward dark gold), and the drop-shadow strokes
|
|
7
7
|
sit in dark gold so every letterform — the B's bowls especially — stays crisp instead of dissolving
|
|
8
8
|
into the background. Both endpoint colors come from `theme.py`, so the banner restyles with the
|
|
@@ -216,7 +216,7 @@ class SlabClient:
|
|
|
216
216
|
|
|
217
217
|
def vocab(self) -> VocabOut | None:
|
|
218
218
|
"""The served vocabulary, fetched at most ONCE per process and None when the API can't
|
|
219
|
-
answer (offline, unauthorized, down). Same contract as the
|
|
219
|
+
answer (offline, unauthorized, down). Same contract as the docs pages' vocab read: a
|
|
220
220
|
picker renders the served list when it has one and its static fallback otherwise, so a
|
|
221
221
|
new grading company reaches the CLI with no release — and a dead API never blocks a
|
|
222
222
|
prompt. The miss is cached too, so one failure doesn't retry at every prompt."""
|
|
@@ -131,6 +131,6 @@ def cmd_rainbow(args: list[str]) -> None:
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
def cmd_community(args: list[str]) -> None:
|
|
134
|
-
"""The whole community picture — the same page the
|
|
134
|
+
"""The whole community picture — the same page the collection site shows: catalog overview, an activity
|
|
135
135
|
ticker, leaderboards (most valuable, most collected, rarest owned), and popular chase sets."""
|
|
136
136
|
render_community_board(ctx.client.get_community_board())
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Setup commands — check identity.
|
|
2
2
|
|
|
3
3
|
Collectors are NOT created here. Your account and its collector are provisioned when you sign up
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
at collection.slab.dev-jeb.com; the CLI just consumes the API key and collector UUID you copy from
|
|
5
|
+
your account's API keys page there (/account/api-keys). SLAB_COLLECTOR is required and explicit —
|
|
6
|
+
the CLI does not guess a collector from the account, so you must set it to that UUID.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
@@ -30,7 +30,7 @@ class CliContext:
|
|
|
30
30
|
def collector(self) -> str:
|
|
31
31
|
"""The active collector UUID, from the SLAB_COLLECTOR env var. Required and explicit — the
|
|
32
32
|
CLI does not guess or auto-resolve a collector from the account. Copy your collector's UUID
|
|
33
|
-
from
|
|
33
|
+
from your account's API keys page (collection.slab.dev-jeb.com/account/api-keys) and set SLAB_COLLECTOR to it; if it's unset this raises
|
|
34
34
|
MissingCollector. Cached per invocation."""
|
|
35
35
|
if self._collector:
|
|
36
36
|
return self._collector
|
|
@@ -740,7 +740,7 @@ def render_dashboard(d: DashboardStats) -> None:
|
|
|
740
740
|
rows.append(("Unrealized", f"{signed_money(d.total_unrealized_gain_loss)}{roi_str}"))
|
|
741
741
|
if d.priced_coverage is not None:
|
|
742
742
|
rows.append(("Coverage", f"{pct_coverage(float(d.priced_coverage) * 100)} [slab.dim]priced[/]"))
|
|
743
|
-
# Portfolio value over time — the CLI stand-in for the
|
|
743
|
+
# Portfolio value over time — the CLI stand-in for the collection site's chart, from the same payload.
|
|
744
744
|
# Each point values only the copies owned that day, so the net includes cards you ADDED in
|
|
745
745
|
# the window, not just price movement — said plainly so it isn't read as a 90d gain.
|
|
746
746
|
if len(d.portfolio_series) >= 2:
|
|
@@ -826,7 +826,7 @@ def _catalog_stat_panels(c: CatalogStats, *, title: str = "📚 slab catalog")
|
|
|
826
826
|
|
|
827
827
|
|
|
828
828
|
# ---------------------------------------------------------------------------
|
|
829
|
-
# Community board (mirrors the
|
|
829
|
+
# Community board (mirrors the collection site's Community page)
|
|
830
830
|
# ---------------------------------------------------------------------------
|
|
831
831
|
|
|
832
832
|
def _ccard_label(card: CommunityCard) -> str:
|
|
@@ -945,7 +945,7 @@ def _ticker_panel(items: list[TickerItem]) -> Group | None:
|
|
|
945
945
|
|
|
946
946
|
def render_community_board(b: CommunityBoard) -> None:
|
|
947
947
|
"""The whole community picture — catalog overview + activity ticker + leaderboards + popular
|
|
948
|
-
chase sets — mirroring the
|
|
948
|
+
chase sets — mirroring the collection site's community page from the single GET /community payload."""
|
|
949
949
|
for panel in _catalog_stat_panels(b.stats, title="🌐 community board"):
|
|
950
950
|
console.print(panel)
|
|
951
951
|
|
|
@@ -55,7 +55,7 @@ def render_command_help(group: Group, command: Command) -> None:
|
|
|
55
55
|
doc = inspect.getdoc(command.handler)
|
|
56
56
|
if doc:
|
|
57
57
|
# The handler docstring is the authoritative per-command detail — print it verbatim,
|
|
58
|
-
# indented, so a leaf command explains itself with no
|
|
58
|
+
# indented, so a leaf command explains itself with no web round-trip.
|
|
59
59
|
body = "\n".join(f" {line}" for line in doc.splitlines())
|
|
60
60
|
console.print(Text.from_markup(f"\n[slab.dim]{body}[/]"))
|
|
61
61
|
flags = getattr(command.handler, "flags", None)
|
|
@@ -106,8 +106,8 @@ def _dispatch(args: list[str]) -> int:
|
|
|
106
106
|
return 2
|
|
107
107
|
except MissingCollector:
|
|
108
108
|
console.print("[red]No collector resolved for this API key.[/red]")
|
|
109
|
-
console.print(" Your collector is created when you sign up
|
|
110
|
-
console.print("
|
|
109
|
+
console.print(" Your collector is created when you sign up at collection.slab.dev-jeb.com.")
|
|
110
|
+
console.print(" Copy its UUID from https://collection.slab.dev-jeb.com/account/api-keys, then: export SLAB_COLLECTOR=<uuid>")
|
|
111
111
|
return 1
|
|
112
112
|
except ApiConnectionError as e:
|
|
113
113
|
console.print(f"\n[red]{e}[/red]")
|
|
@@ -120,7 +120,7 @@ def _dispatch(args: list[str]) -> int:
|
|
|
120
120
|
# as a cryptic "Not found" — point the user at the fix instead.
|
|
121
121
|
console.print("[red]Your active collector wasn't found for this account.[/red]")
|
|
122
122
|
console.print(" See which one the CLI is using: [bold]slab collector current[/bold]")
|
|
123
|
-
console.print(" Then set SLAB_COLLECTOR to a collector UUID from
|
|
123
|
+
console.print(" Then set SLAB_COLLECTOR to a collector UUID from https://collection.slab.dev-jeb.com/account/api-keys")
|
|
124
124
|
elif e.status == 404:
|
|
125
125
|
console.print(f"[yellow]Not found: {e.detail}[/yellow]")
|
|
126
126
|
elif e.status == 401:
|
|
@@ -441,7 +441,7 @@ def select_grade(message: str = "Your grade assessment:") -> str | None:
|
|
|
441
441
|
# Served-vocab pickers
|
|
442
442
|
# ---------------------------------------------------------------------------
|
|
443
443
|
# These lists come from GET /vocab when the API answers and fall back to the literals below when it
|
|
444
|
-
# doesn't — the
|
|
444
|
+
# doesn't — the docs pages' vocab pattern (frontend `fetchDocsVocab`). Grading companies are LIVE
|
|
445
445
|
# catalog rows (a new one appears when a set is seeded), and the wire enums can grow in a schemas
|
|
446
446
|
# release the installed CLI predates; either way the served list is the truth and the fallback is
|
|
447
447
|
# only what this build knew. The label maps are the human wording for the values we know about; an
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""SLAB terminal theme — the CLI's shared visual language.
|
|
2
2
|
|
|
3
|
-
Mirrors the
|
|
3
|
+
Mirrors the collection site's retro card-collector look (`frontend/src/app/globals.css`): gold **foil** as the
|
|
4
4
|
hero accent over slate surfaces, green gains / red losses, uppercase pixel-style headings, rounded
|
|
5
5
|
"cards". Every command should render through the `console` and factories here so the whole CLI reads
|
|
6
6
|
as one system — restyle in this one file and it propagates everywhere.
|
|
@@ -25,7 +25,7 @@ from rich.table import Table
|
|
|
25
25
|
from rich.text import Text
|
|
26
26
|
from rich.theme import Theme
|
|
27
27
|
|
|
28
|
-
# --- Palette (hex mirrors
|
|
28
|
+
# --- Palette (hex mirrors frontend/src/app/globals.css :theme tokens) --------------------------------
|
|
29
29
|
FOIL = "#f0b429" # gold — the hero accent (foil)
|
|
30
30
|
FOIL_DIM = "#b8860b"
|
|
31
31
|
TEXT = "#e2e8f0"
|
|
@@ -56,14 +56,14 @@ SLAB_THEME = Theme({
|
|
|
56
56
|
|
|
57
57
|
console = Console(theme=SLAB_THEME)
|
|
58
58
|
|
|
59
|
-
# The card silhouette — rounded + thin, mirroring the
|
|
59
|
+
# The card silhouette — rounded + thin, mirroring the collection site's rounded-border cards.
|
|
60
60
|
CARD_BOX = box.ROUNDED
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
# --- Headers ---------------------------------------------------------------------------------------
|
|
64
64
|
|
|
65
65
|
def heading(text: str, note: str | None = None) -> Text:
|
|
66
|
-
"""A section header in the
|
|
66
|
+
"""A section header in the collection site's pixel-heading style: a slim foil marker + uppercase gold
|
|
67
67
|
title, left-aligned, with an optional dim note (e.g. a count) trailing it. The marker gives every
|
|
68
68
|
titled block across the CLI the same on-theme spine. Print it on its own line above the content."""
|
|
69
69
|
t = Text()
|
|
@@ -78,7 +78,7 @@ def heading(text: str, note: str | None = None) -> Text:
|
|
|
78
78
|
|
|
79
79
|
def slab_table(columns: list[tuple[str, dict]], *, foil: bool = False) -> Table:
|
|
80
80
|
"""Build a card-styled table. `columns` is a list of `(header, column_kwargs)` — headers are
|
|
81
|
-
uppercased to match the
|
|
81
|
+
uppercased to match the site's table headers (uppercase, muted). `foil=True` swaps the slate
|
|
82
82
|
border for the gold "hero card" border."""
|
|
83
83
|
table = Table(
|
|
84
84
|
box=CARD_BOX,
|
|
@@ -94,7 +94,7 @@ def slab_table(columns: list[tuple[str, dict]], *, foil: bool = False) -> Table:
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
def slab_panel(body: RenderableType, *, foil: bool = True, title: str | None = None) -> Panel:
|
|
97
|
-
"""Wrap a renderable in a card. Foil (gold) border by default — that's the "hero card" the
|
|
97
|
+
"""Wrap a renderable in a card. Foil (gold) border by default — that's the "hero card" the collection site
|
|
98
98
|
reserves for headline stats; pass `foil=False` for an ordinary slate card. Padding is tight
|
|
99
99
|
(no blank top/bottom line) so a card hugs its content instead of reading as a near-empty box."""
|
|
100
100
|
return Panel(
|
|
@@ -174,7 +174,7 @@ _SPARK_TICKS = "▁▂▃▄▅▆▇█"
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
def sparkline(values: list, *, style: str = "slab.foil", width: int = 24) -> str:
|
|
177
|
-
"""A one-line trend as unicode blocks (`▁▂▅▇█`) — the compact CLI stand-in for the
|
|
177
|
+
"""A one-line trend as unicode blocks (`▁▂▅▇█`) — the compact CLI stand-in for the collection site's
|
|
178
178
|
portfolio chart. Series longer than `width` are evenly downsampled (the dashboard payload's
|
|
179
179
|
embedded trend is daily, ~90 points). Returns markup, or '' when there's nothing to plot
|
|
180
180
|
(<2 points)."""
|
|
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
|