Skip to content

Commit e14d9ef

Browse files
Merge pull request #242 from digitalghost-dev/1.8.9
1.8.9
2 parents 9bd620f + 2612e63 commit e14d9ef

File tree

24 files changed

+434
-36
lines changed

24 files changed

+434
-36
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
- main
3232

3333
env:
34-
VERSION_NUMBER: 'v1.8.8'
34+
VERSION_NUMBER: 'v1.8.9'
3535
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3636
AWS_REGION: 'us-west-2'
3737

.github/workflows/go_lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint
1+
name: Golang Lint
22

33
on:
44
pull_request:

.github/workflows/python_lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Python Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
paths:
7+
- 'card_data/**'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
ruff:
14+
runs-on: ubuntu-22.04
15+
defaults:
16+
run:
17+
working-directory: card_data
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v6
25+
with:
26+
python-version: '3.12'
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v7
30+
31+
- name: Install ruff
32+
run: uv tool install ruff
33+
34+
- name: Lint
35+
run: ruff check pipelines/
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Python Type Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
paths:
7+
- 'card_data/**'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
pyrefly:
14+
runs-on: ubuntu-22.04
15+
defaults:
16+
run:
17+
working-directory: card_data
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v6
25+
with:
26+
python-version: '3.12'
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v7
30+
31+
- name: Install dependencies
32+
run: uv sync --dev
33+
34+
- name: Type check
35+
run: uvx pyrefly check --summarize-errors

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ builds:
1414
- windows
1515
- darwin
1616
ldflags:
17-
- -s -w -X main.version=v1.8.8
17+
- -s -w -X main.version=v1.8.9
1818

1919
archives:
2020
- formats: [ 'zip' ]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN go mod download
88

99
COPY . .
1010

11-
RUN go build -ldflags "-X main.version=v1.8.8" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v1.8.9" -o poke-cli .
1212

1313
# build 2
1414
FROM --platform=$BUILDPLATFORM alpine:3.23

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img width="425" src="poke-cli.png" alt="pokemon-logo"/>
33
<h4></h4>
44
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
5-
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.8.8?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
5+
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.8.9?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
66
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
77
</div>
88
<div align="center">
@@ -23,15 +23,18 @@ View the [documentation](https://docs.poke-cli.com) on the data infrastructure i
2323
* [Tested Terminals](#tested-terminals)
2424

2525
---
26+
2627
## Demo
2728
### Video Game Data
2829

2930
![demo-vg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.6.0.gif)
3031

3132
### Trading Card Game Data
3233

33-
![demo-tcg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/poke-cli-v1.8.0.gif)
34+
![demo-tcg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/poke-cli-card-v1.8.8.gif)
35+
3436
---
37+
3538
## Installation
3639

3740
* [Homebrew](#homebrew)
@@ -96,11 +99,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
9699
3. Choose how to interact with the container:
97100
* Run a single command and exit:
98101
```bash
99-
docker run --rm -it digitalghostdev/poke-cli:v1.8.8 <command> [subcommand] [flag]
102+
docker run --rm -it digitalghostdev/poke-cli:v1.8.9 <command> [subcommand] [flag]
100103
```
101104
* Enter the container and use its shell:
102105
```bash
103-
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.8 -c "cd /app && exec sh"
106+
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.9 -c "cd /app && exec sh"
104107
# placed into the /app directory, run the program with './poke-cli'
105108
# example: ./poke-cli ability swift-swim
106109
```

card_data/pipelines/definitions.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,43 @@ def defs() -> dg.Definitions:
2424
sensors=[discord_success_sensor, discord_failure_sensor],
2525
)
2626

27-
# Pricing pipeline
28-
pricing_pipeline_job = dg.define_asset_job(
27+
# Pricing pipeline job
28+
pricing_pipeline = dg.define_asset_job(
2929
name="pricing_pipeline_job",
3030
selection=dg.AssetSelection.assets(build_dataframe).downstream(include_self=True),
3131
)
3232

3333
price_schedule: dg.ScheduleDefinition = dg.ScheduleDefinition(
3434
name="price_schedule",
3535
cron_schedule="0 14 * * *",
36-
target=pricing_pipeline_job,
36+
target=pricing_pipeline,
3737
execution_timezone="America/Los_Angeles",
3838
)
3939

4040
defs_pricing: dg.Definitions = dg.Definitions(
4141
assets=[build_dataframe, load_pricing_data, data_quality_checks_on_pricing],
42-
jobs=[pricing_pipeline_job],
42+
jobs=[pricing_pipeline],
4343
schedules=[price_schedule],
4444
)
4545

46-
# Series pipeline
47-
series_pipeline_job = dg.define_asset_job(
46+
# Series pipeline job
47+
series_pipeline = dg.define_asset_job(
4848
name="series_pipeline_job",
4949
selection=dg.AssetSelection.assets(extract_series_data).downstream(include_self=True),
5050
)
5151

5252
defs_series: dg.Definitions = dg.Definitions(
5353
assets=[extract_series_data, load_series_data, data_quality_check_on_series],
54-
jobs=[series_pipeline_job],
54+
jobs=[series_pipeline],
5555
)
5656

57-
# Sets pipeline
58-
sets_pipeline_job = dg.define_asset_job(
57+
# Sets pipeline job
58+
sets_pipeline = dg.define_asset_job(
5959
name="sets_pipeline_job",
6060
selection=dg.AssetSelection.assets(extract_sets_data).downstream(include_self=True),
6161
)
6262

6363
defs_sets: dg.Definitions = dg.Definitions(
6464
assets=[extract_sets_data, load_sets_data, data_quality_check_on_sets],
65-
jobs=[sets_pipeline_job],
65+
jobs=[sets_pipeline],
6666
)

card_data/pipelines/defs/extract/tcgcsv/extract_pricing.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111

1212
SET_PRODUCT_MATCHING = {
13+
# Mega Evolution
14+
"me02.5": "24541",
1315
"me02": "24448",
1416
"me01": "24380",
1517
# Scarlet & Violet
@@ -57,7 +59,7 @@ class CardPricing(BaseModel):
5759

5860

5961
def is_card(item: dict) -> bool:
60-
"""Check if item has a 'Number' field in extendedData"""
62+
"""Check if an item has a 'Number' field in extendedData"""
6163
return any(
6264
data_field.get("name") == "Number"
6365
for data_field in item.get("extendedData", [])
@@ -126,15 +128,33 @@ def pull_product_information(set_number: str) -> pl.DataFrame:
126128
if not is_card(card):
127129
continue
128130

129-
# Skip ball pattern variants (unique to Prismatic Evolutions)
131+
# Skip cosmetic holofoil pattern variants.
132+
# Prismatic Evolutions (SV08.5) uses Poke Ball / Master Ball patterns.
133+
# Ascended Heroes (ME2.5) uses ball-type and energy symbol patterns.
130134
card_name = card.get("name", "")
131-
if "(Poke Ball Pattern)" in card_name or "(Master Ball Pattern)" in card_name:
135+
skip_variants = [
136+
"(Poke Ball Pattern)",
137+
"(Master Ball Pattern)",
138+
"(Love Ball)",
139+
"(Energy Symbol Pattern)",
140+
"(Poke Ball)",
141+
"(Dusk Ball)",
142+
"(Quick Ball)",
143+
"(Friend Ball)",
144+
"(Team Rocket)",
145+
"(Exclusive)",
146+
]
147+
if any(variant in card_name for variant in skip_variants):
148+
continue
149+
150+
card_number = get_card_number(card)
151+
if card_number is None:
132152
continue
133153

134154
card_info = {
135155
"product_id": card["productId"],
136156
"name": extract_card_name(card_name),
137-
"card_number": get_card_number(card),
157+
"card_number": card_number,
138158
"market_price": price_dict.get(card["productId"]),
139159
}
140160
cards_data.append(card_info)

card_data/pipelines/defs/extract/tcgdex/extract_cards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@dg.asset(kinds={"API"}, name="extract_card_url_from_set_data")
1212
def extract_card_url_from_set() -> list:
13-
urls = ["https://api.tcgdex.net/v2/en/sets/me02"]
13+
urls = ["https://api.tcgdex.net/v2/en/sets/me02.5"]
1414

1515
all_card_urls = []
1616

0 commit comments

Comments
 (0)