slab-cli 0.30.0__tar.gz → 0.30.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.30.0 → slab_cli-0.30.1}/PKG-INFO +1 -1
- {slab_cli-0.30.0 → slab_cli-0.30.1}/pyproject.toml +1 -1
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/display.py +27 -16
- {slab_cli-0.30.0 → slab_cli-0.30.1}/README.md +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/__init__.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/banner.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/browse.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/client.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/__init__.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/breaks.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/catalog.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/collection.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/custom_sets.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/export.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/lots.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/pricing.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/registry.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/setup.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/commands/update.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/config.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/context.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/flags.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/help.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/main.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/nav.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/paging.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/picker.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/platforms/__init__.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/platforms/base.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/platforms/posix.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/platforms/windows.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/prompts.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/sources.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/theme.py +0 -0
- {slab_cli-0.30.0 → slab_cli-0.30.1}/src/slab_cli/updates.py +0 -0
|
@@ -23,7 +23,7 @@ from slab_schemas.glossary import MetricInfo
|
|
|
23
23
|
from slab_schemas.grading_desk import CollectionGradingDesk, GradingDesk
|
|
24
24
|
from slab_schemas.enums import BreakEvenRegion, Grade, LiquidityLabel, SealedFormat
|
|
25
25
|
from slab_schemas.liquidity import Liquidity
|
|
26
|
-
from slab_schemas.metrics import momentum_label, trend_label
|
|
26
|
+
from slab_schemas.metrics import momentum_label, trend_label, velocity_ratio
|
|
27
27
|
from slab_schemas.pricing import CardComps, CardMarket, PortfolioSummary, SetTopCards
|
|
28
28
|
from slab_schemas.sealed import SealedPriceHistory, SealedProductOut
|
|
29
29
|
from slab_schemas.serials import CardSerials
|
|
@@ -884,7 +884,7 @@ def _collected_players_table(entries: list[CollectedPlayer]) -> Group | None:
|
|
|
884
884
|
return titled("Most Collected Players", table)
|
|
885
885
|
|
|
886
886
|
|
|
887
|
-
# The hottest-players badges render the label the SERVER computed (`HotPlayer.
|
|
887
|
+
# The hottest-players badges render the label the SERVER computed (`HotPlayer.velocity.label` /
|
|
888
888
|
# `HotPlayer.trend`). The thresholds that turn a ratio into "up" are the API's metric
|
|
889
889
|
# definitions (`slab_schemas.metrics`), not the CLI's to copy: three clients once each carried
|
|
890
890
|
# their own ±2% band and disagreed. When an older server omits the fields, the fallback is the
|
|
@@ -892,18 +892,29 @@ def _collected_players_table(entries: list[CollectedPlayer]) -> Group | None:
|
|
|
892
892
|
# `tests/test_hot_labels.py` asserts no threshold number lives in this module.
|
|
893
893
|
|
|
894
894
|
|
|
895
|
-
def
|
|
896
|
-
"""
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
895
|
+
def _ratio_text(ratio: float | None) -> str | None:
|
|
896
|
+
""""2×", "2.3×", "0.5×", "12×" — the same trimming as the collection app's velocity badge."""
|
|
897
|
+
if ratio is None:
|
|
898
|
+
return None
|
|
899
|
+
digits = 0 if ratio >= 10 else 1 if ratio >= 1 else 2
|
|
900
|
+
text = f"{ratio:.{digits}f}"
|
|
901
|
+
return (text.rstrip("0").rstrip(".") if "." in text else text) + "×"
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
def _hot_velocity(e: HotPlayer) -> str:
|
|
905
|
+
"""Sales velocity, written as everywhere: "2× (2 → 4)" — the served ratio in its served label's
|
|
906
|
+
tone, then the earlier window's count and the newer one's. From an older server with no
|
|
907
|
+
velocity block: the 30-day counts, with the registry's own label and ratio."""
|
|
908
|
+
v = e.velocity
|
|
909
|
+
if v is None:
|
|
910
|
+
sales, prior = e.observed.sales, e.observed_prior.sales
|
|
911
|
+
label, ratio = e.momentum or momentum_label(sales, prior), velocity_ratio(sales, prior)
|
|
912
|
+
else:
|
|
913
|
+
sales, prior, label, ratio = v.sales, v.sales_prior, v.label, v.ratio
|
|
914
|
+
lead = _ratio_text(ratio) or ("new" if label == "new" else None)
|
|
915
|
+
tone = "slab.accent" if label in ("up", "new") else "slab.dim"
|
|
916
|
+
counts = f"[slab.dim]({prior} → {sales})[/]"
|
|
917
|
+
return f"[{tone}]{lead}[/] {counts}" if lead else counts
|
|
907
918
|
|
|
908
919
|
|
|
909
920
|
def _hot_trend(e: HotPlayer) -> str:
|
|
@@ -929,7 +940,7 @@ def _hottest_players_table(entries: list[HotPlayer], seen: MetricInfo | None = N
|
|
|
929
940
|
table = slab_table([
|
|
930
941
|
("Player", {"style": "slab.value"}),
|
|
931
942
|
("Sales seen (30d)", {"justify": "right", "style": "slab.value"}),
|
|
932
|
-
("
|
|
943
|
+
("Velocity", {"justify": "right"}),
|
|
933
944
|
("$ seen", {"justify": "right"}),
|
|
934
945
|
("Cards", {"justify": "right", "style": "slab.dim"}),
|
|
935
946
|
("Prices", {"justify": "right"}),
|
|
@@ -938,7 +949,7 @@ def _hottest_players_table(entries: list[HotPlayer], seen: MetricInfo | None = N
|
|
|
938
949
|
table.add_row(
|
|
939
950
|
e.name,
|
|
940
951
|
str(e.observed.sales),
|
|
941
|
-
|
|
952
|
+
_hot_velocity(e),
|
|
942
953
|
money(e.observed.dollars),
|
|
943
954
|
str(e.observed.cards) if e.observed.cards is not None else "—",
|
|
944
955
|
_hot_trend(e),
|
|
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
|