Skip to content

Commit d55869a

Browse files
Merge pull request #203 from digitalghost-dev/1.8.0
1.8.0
2 parents f829bc2 + f5a3282 commit d55869a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2163
-130
lines changed

.github/workflows/ci.yml

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

3232
env:
33-
VERSION_NUMBER: 'v1.7.4'
33+
VERSION_NUMBER: 'v1.8.0'
3434
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3535
AWS_REGION: 'us-west-2'
3636

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ dbt_packages/
5050
logs/
5151

5252
target/
53-
dbt_packages/
5453

5554
card_data/infrastructure/supabase/access-token
5655
/card_data/infrastructure/supabase/access-token
@@ -61,5 +60,6 @@ card_data/.tmp*/**
6160

6261
card_data/pipelines/poke_cli_dbt/.user.yml
6362
/card_data/supabase/
63+
/card_data/sample_scripts/
6464

6565
card_data/~/

.gitleaksignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cmd/card/setslist.go:generic-api-key:116
2+
cmd/card/cardlist.go:generic-api-key:157
3+
codecov.yml:generic-api-key:2

.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.7.4
17+
- -s -w -X main.version=v1.8.0
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.7.4" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v1.8.0" -o poke-cli .
1212

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

README.md

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
<img height="250" width="350" src="pokemon.svg" alt="pokemon-logo"/>
33
<h1>Pokémon CLI</h1>
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.7.4?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.0?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>
8-
<div align="center">
9-
<img src="https://img.shields.io/coderabbit/prs/github/digitalghost-dev/poke-cli?style=flat-square&logo=coderabbit&logoColor=FF570A&labelColor=F6F6F1&color=FF570A" alt="coderabbit-review-count-badge">
10-
</div>
118
<div align="center">
129
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/go_test.yml?style=flat-square&logo=go&logoColor=00ADD8&label=Tests&labelColor=EEE&color=00ADD8" alt="tests-label">
1310
<img src="https://img.shields.io/github/go-mod/go-version/digitalghost-dev/poke-cli?style=flat-square&logo=Go&labelColor=EEE&color=00ADD8" alt="go-version"/>
@@ -18,17 +15,21 @@
1815
`poke-cli` is a hybrid of a classic CLI and a modern TUI tool for viewing data about Pokémon! This is my first Go project.
1916
View the [documentation](https://docs.poke-cli.com)!
2017

21-
The architecture behind how the tool works is straight forward:
22-
1. Each command indicates which [API](https://pokeapi.co/) endpoint to use.
23-
2. Flags provide more information and can be stacked together or used individually.
24-
3. Each command has a `-h | --help` flag that is built-in with Golang's `flag` package.
25-
26-
View future plans in the [Roadmap](#roadmap) section.
18+
* [Demo](#demo)
19+
* [Installation](#installation)
20+
* [Usage](#usage)
21+
* [Roadmap](#roadmap)
22+
* [Tested Terminals](#tested-terminals)
2723

2824
---
2925
## Demo
30-
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.6.0.gif)
26+
### Video Game Data
27+
28+
![demo-vg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.6.0.gif)
29+
30+
### Trading Card Game Data
3131

32+
![demo-tcg](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/poke-cli-v1.8.0.gif)
3233
---
3334
## Installation
3435

@@ -94,11 +95,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
9495
3. Choose how to interact with the container:
9596
* Run a single command and exit:
9697
```bash
97-
docker run --rm -it digitalghostdev/poke-cli:v1.7.4 <command> [subcommand] flag]
98+
docker run --rm -it digitalghostdev/poke-cli:v1.8.0 <command> [subcommand] flag]
9899
```
99100
* Enter the container and use its shell:
100101
```bash
101-
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.7.4 -c "cd /app && exec sh"
102+
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.8.0 -c "cd /app && exec sh"
102103
# placed into the /app directory, run the program with './poke-cli'
103104
# example: ./poke-cli ability swift-swim
104105
```
@@ -162,6 +163,7 @@ By running `poke-cli [-h | --help]`, it'll display information on how to use the
162163
│ COMMANDS: │
163164
│ ability Get details about an ability │
164165
│ berry Get details about a berry │
166+
│ card Get details about a TCG card │
165167
│ item Get details about an item │
166168
│ move Get details about a move │
167169
│ natures Get details about all natures │
@@ -187,6 +189,12 @@ Below is a list of the planned/completed commands and flags:
187189
- [x] `ability`: get data about an ability.
188190
- [x] `-p | --pokemon`: display Pokémon that learn this ability.
189191
- [x] `berry`: get data about a berry.
192+
- [ ] `card`: get data about a TCG card.
193+
- [x] add mega evolution data
194+
- [x] add scarlet & violet data
195+
- [ ] add sword & shield data
196+
- [ ] add sun & moon data
197+
- [ ] add x & y data
190198
- [x] `item`: get data about an item.
191199
- [x] `move`: get data about a move.
192200
- [ ] `-p | --pokemon`: display Pokémon that learn this move.
@@ -208,15 +216,16 @@ Below is a list of the planned/completed commands and flags:
208216

209217
---
210218
## Tested Terminals
211-
| Terminal | OS | Status | Issues |
212-
|-------------------|:-------------------------:|:------:|---------------------------------------------------------------------------------|
213-
| Alacritty | macOS, Ubuntu,<br>Windows || None |
214-
| Ghostty | macOS || None |
215-
| HyperJS | macOS || None |
216-
| iTerm2 | macOS || None |
217-
| Built-in Terminal | Ubuntu, Debian,<br>Fedora || None |
218-
| Built-in Terminal | Alpine | ⚠️ | Some colors aren't supported.<br>`pokemon <name> --image=xx` flag pixel issues. |
219-
| Built-in Terminal | macOS | ⚠️ | `pokemon <name> --image=xx` flag pixel issues. |
220-
| Tabby | Ubuntu | ✅ | None |
221-
| WezTerm | macOS, Windows | ✅ | None |
222-
| Built-in Terminal | Windows | ✅ | None |
219+
| Terminal | OS | Status | Issues |
220+
|-------------------|:-------------------------:|:------:|----------------------------------------------------------------------------------------------|
221+
| Alacritty | macOS, Ubuntu,<br>Windows | 🟡 | - Does not support sixel for TCG images. |
222+
| Ghostty | macOS | 🟡 | - Does not support sixel for TCG images. |
223+
| HyperJS | macOS | 🟡 | - Does not support sixel for TCG images. |
224+
| iTerm2 | macOS | 🟢 | - None |
225+
| Built-in Terminal | Ubuntu, Debian,<br>Fedora | 🟡 | - Does not support sixel for TCG images. |
226+
| Built-in Terminal | Alpine | 🟡 | - Some colors aren't supported.<br>- `pokemon <name> --image=xx` flag pixel issues. |
227+
| Built-in Terminal | macOS | 🟠 | - Does not support sixel for TCG images.<br>- `pokemon <name> --image=xx` flag pixel issues. |
228+
| Foot | Ubuntu | 🟢 | - None |
229+
| Tabby | Ubuntu | 🟢 | - None |
230+
| WezTerm | macOS, Windows | 🟡 | - Windows version has issues with displaying TCG images. |
231+
| Built-in Terminal | Windows | 🟢 | - None |

card_data/dagster.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ storage:
99
db_name: postgres
1010
port: 5432
1111
params:
12-
sslmode: require
12+
sslmode: require
13+
14+
telemetry:
15+
enabled: false

card_data/pipelines/definitions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import dagster as dg
66

77
from .defs.extract.extract_pricing_data import build_dataframe
8-
from .defs.load.load_pricing_data import load_pricing_data
8+
from .defs.load.load_pricing_data import load_pricing_data, data_quality_checks_on_pricing
99

1010

1111
@definitions
@@ -17,7 +17,7 @@ def defs():
1717
# Define the pricing pipeline job that materializes the assets and downstream dbt model
1818
pricing_pipeline_job = dg.define_asset_job(
1919
name="pricing_pipeline_job",
20-
selection=dg.AssetSelection.assets(build_dataframe, load_pricing_data).downstream(include_self=True),
20+
selection=dg.AssetSelection.assets(build_dataframe).downstream(include_self=True),
2121
)
2222

2323
price_schedule = dg.ScheduleDefinition(
@@ -28,7 +28,7 @@ def defs():
2828
)
2929

3030
defs_pricing = dg.Definitions(
31-
assets=[build_dataframe, load_pricing_data],
31+
assets=[build_dataframe, load_pricing_data, data_quality_checks_on_pricing],
3232
jobs=[pricing_pipeline_job],
3333
schedules=[price_schedule],
3434
)

card_data/pipelines/defs/extract/extract_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ def extract_set_data() -> pl.DataFrame:
9090
@dg.asset(kinds={"API"}, name="extract_card_url_from_set_data")
9191
def extract_card_url_from_set() -> list:
9292
urls = [
93-
"https://api.tcgdex.net/v2/en/sets/swsh3"
93+
"https://api.tcgdex.net/v2/en/sets/me02"
9494
]
9595

96-
all_card_urls = [] # Initialize empty list to collect all URLs
96+
all_card_urls = []
9797

9898
for url in urls:
9999
try:
@@ -103,7 +103,7 @@ def extract_card_url_from_set() -> list:
103103
data = r.json()["cards"]
104104

105105
set_card_urls = [f"https://api.tcgdex.net/v2/en/cards/{card['id']}" for card in data]
106-
all_card_urls.extend(set_card_urls) # Add all URLs from this set
106+
all_card_urls.extend(set_card_urls)
107107

108108
time.sleep(0.1)
109109

card_data/pipelines/defs/extract/extract_pricing_data.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
SET_PRODUCT_MATCHING = {
1111
"sv01": "22873",
1212
"sv02": "23120",
13+
"sv03": "23228",
14+
"sv03.5": "23237",
15+
"sv04": "23286",
16+
"sv04.5": "23353",
17+
"sv05": "23381",
18+
"sv06": "23473",
19+
"sv06.5": "23529",
20+
"sv07": "23537",
21+
"sv08": "23651",
22+
"sv08.5": "23821",
23+
"sv09": "24073",
24+
"sv10": "24269",
25+
"sv10.5b": "24325",
26+
"sv10.5w": "24326",
27+
"me01": "24380",
28+
"me02": "24448"
1329
}
1430

1531

@@ -49,16 +65,17 @@ def pull_product_information(set_number: str) -> pl.DataFrame:
4965
product_id = SET_PRODUCT_MATCHING[set_number]
5066

5167
# Fetch product data
52-
products_url = (f"https://tcgcsv.com/tcgplayer/3/{product_id}/products")
68+
products_url = f"https://tcgcsv.com/tcgplayer/3/{product_id}/products"
5369
products_data = requests.get(products_url, timeout=30).json()
5470

5571
# Fetch pricing data
56-
prices_url = (f"https://tcgcsv.com/tcgplayer/3/{product_id}/prices")
72+
prices_url = f"https://tcgcsv.com/tcgplayer/3/{product_id}/prices"
5773
prices_data = requests.get(prices_url, timeout=30).json()
5874

5975
price_dict = {
6076
price["productId"]: price.get("marketPrice")
6177
for price in prices_data.get("results", [])
78+
if price.get("subTypeName") != "Reverse Holofoil"
6279
}
6380

6481
cards_data = []

0 commit comments

Comments
 (0)