Skip to content
Merged

1.8.9 #242

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
- main

env:
VERSION_NUMBER: 'v1.8.8'
VERSION_NUMBER: 'v1.8.9'
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
AWS_REGION: 'us-west-2'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: Golang Lint

on:
pull_request:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python Lint

on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'card_data/**'

permissions:
contents: read

jobs:
ruff:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: card_data

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install ruff
run: uv tool install ruff

- name: Lint
run: ruff check pipelines/
35 changes: 35 additions & 0 deletions .github/workflows/python_typing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python Type Check

on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'card_data/**'

permissions:
contents: read

jobs:
pyrefly:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: card_data

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync --dev

- name: Type check
run: uvx pyrefly check --summarize-errors
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
- windows
- darwin
ldflags:
- -s -w -X main.version=v1.8.8
- -s -w -X main.version=v1.8.9

archives:
- formats: [ 'zip' ]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN go mod download

COPY . .

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

# build 2
FROM --platform=$BUILDPLATFORM alpine:3.23
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img width="425" src="poke-cli.png" alt="pokemon-logo"/>
<h4></h4>
<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">
<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">
<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">
<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">
</div>
<div align="center">
Expand All @@ -23,15 +23,18 @@ View the [documentation](https://docs.poke-cli.com) on the data infrastructure i
* [Tested Terminals](#tested-terminals)

---

## Demo
### Video Game Data

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

### Trading Card Game Data

![demo-tcg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/poke-cli-v1.8.0.gif)
![demo-tcg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/poke-cli-card-v1.8.8.gif)

---

## Installation

* [Homebrew](#homebrew)
Expand Down Expand Up @@ -96,11 +99,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
3. Choose how to interact with the container:
* Run a single command and exit:
```bash
docker run --rm -it digitalghostdev/poke-cli:v1.8.8 <command> [subcommand] [flag]
docker run --rm -it digitalghostdev/poke-cli:v1.8.9 <command> [subcommand] [flag]
```
* Enter the container and use its shell:
```bash
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.8 -c "cd /app && exec sh"
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.9 -c "cd /app && exec sh"
# placed into the /app directory, run the program with './poke-cli'
# example: ./poke-cli ability swift-swim
```
Expand Down
20 changes: 10 additions & 10 deletions card_data/pipelines/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,43 @@ def defs() -> dg.Definitions:
sensors=[discord_success_sensor, discord_failure_sensor],
)

# Pricing pipeline
pricing_pipeline_job = dg.define_asset_job(
# Pricing pipeline job
pricing_pipeline = dg.define_asset_job(
name="pricing_pipeline_job",
selection=dg.AssetSelection.assets(build_dataframe).downstream(include_self=True),
)

price_schedule: dg.ScheduleDefinition = dg.ScheduleDefinition(
name="price_schedule",
cron_schedule="0 14 * * *",
target=pricing_pipeline_job,
target=pricing_pipeline,
execution_timezone="America/Los_Angeles",
)

defs_pricing: dg.Definitions = dg.Definitions(
assets=[build_dataframe, load_pricing_data, data_quality_checks_on_pricing],
jobs=[pricing_pipeline_job],
jobs=[pricing_pipeline],
schedules=[price_schedule],
)

# Series pipeline
series_pipeline_job = dg.define_asset_job(
# Series pipeline job
series_pipeline = dg.define_asset_job(
name="series_pipeline_job",
selection=dg.AssetSelection.assets(extract_series_data).downstream(include_self=True),
)

defs_series: dg.Definitions = dg.Definitions(
assets=[extract_series_data, load_series_data, data_quality_check_on_series],
jobs=[series_pipeline_job],
jobs=[series_pipeline],
)

# Sets pipeline
sets_pipeline_job = dg.define_asset_job(
# Sets pipeline job
sets_pipeline = dg.define_asset_job(
name="sets_pipeline_job",
selection=dg.AssetSelection.assets(extract_sets_data).downstream(include_self=True),
)

defs_sets: dg.Definitions = dg.Definitions(
assets=[extract_sets_data, load_sets_data, data_quality_check_on_sets],
jobs=[sets_pipeline_job],
jobs=[sets_pipeline],
)
28 changes: 24 additions & 4 deletions card_data/pipelines/defs/extract/tcgcsv/extract_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


SET_PRODUCT_MATCHING = {
# Mega Evolution
"me02.5": "24541",
"me02": "24448",
"me01": "24380",
# Scarlet & Violet
Expand Down Expand Up @@ -57,7 +59,7 @@ class CardPricing(BaseModel):


def is_card(item: dict) -> bool:
"""Check if item has a 'Number' field in extendedData"""
"""Check if an item has a 'Number' field in extendedData"""
return any(
data_field.get("name") == "Number"
for data_field in item.get("extendedData", [])
Expand Down Expand Up @@ -126,15 +128,33 @@ def pull_product_information(set_number: str) -> pl.DataFrame:
if not is_card(card):
continue

# Skip ball pattern variants (unique to Prismatic Evolutions)
# Skip cosmetic holofoil pattern variants.
# Prismatic Evolutions (SV08.5) uses Poke Ball / Master Ball patterns.
# Ascended Heroes (ME2.5) uses ball-type and energy symbol patterns.
card_name = card.get("name", "")
if "(Poke Ball Pattern)" in card_name or "(Master Ball Pattern)" in card_name:
skip_variants = [
"(Poke Ball Pattern)",
"(Master Ball Pattern)",
"(Love Ball)",
"(Energy Symbol Pattern)",
"(Poke Ball)",
"(Dusk Ball)",
"(Quick Ball)",
"(Friend Ball)",
"(Team Rocket)",
"(Exclusive)",
]
if any(variant in card_name for variant in skip_variants):
continue

card_number = get_card_number(card)
if card_number is None:
continue

card_info = {
"product_id": card["productId"],
"name": extract_card_name(card_name),
"card_number": get_card_number(card),
"card_number": card_number,
"market_price": price_dict.get(card["productId"]),
}
cards_data.append(card_info)
Expand Down
2 changes: 1 addition & 1 deletion card_data/pipelines/defs/extract/tcgdex/extract_cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

all_card_urls = []

Expand Down
2 changes: 1 addition & 1 deletion card_data/pipelines/defs/extract/tcgdex/extract_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dagster as dg
import polars as pl
from pydantic import BaseModel, HttpUrl, ValidationError
from pydantic import BaseModel, ValidationError
from termcolor import colored

from ....utils.json_retriever import fetch_json
Expand Down
2 changes: 1 addition & 1 deletion card_data/pipelines/poke_cli_dbt/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'poke_cli_dbt'
version: '1.8.8'
version: '1.8.9'

profile: 'poke_cli_dbt'

Expand Down
2 changes: 1 addition & 1 deletion card_data/pipelines/soda/checks_sets.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
checks for sets:
# Row count validation
- row_count = 39
- row_count = 40

# Schema validation checks
- schema:
Expand Down
Loading