Skip to content

Commit db9159f

Browse files
filtering out Pokeball and Masterball rarities
1 parent 63bd440 commit db9159f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

card_data/pipelines/defs/extract/extract_pricing_data.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ def extract_card_name(full_name: str) -> str:
8484
# Remove known variant types in parentheses
8585
# e.g., "(Secret)", "(Full Art)", "(Reverse Holofoil)", etc.
8686
variant_types = [
87-
"Poke Ball Pattern",
88-
"Master Ball Pattern",
8987
"Full Art",
9088
"Secret",
9189
"Reverse Holofoil",
@@ -96,7 +94,6 @@ def extract_card_name(full_name: str) -> str:
9694
name = name.replace(f" ({variant})", "")
9795

9896
# Normalize accented characters (é → e, ñ → n, etc.)
99-
# NFD decomposes characters into base + diacritics, then we filter out diacritics
10097
name = unicodedata.normalize("NFD", name)
10198
name = "".join(char for char in name if unicodedata.category(char) != "Mn")
10299

@@ -129,9 +126,14 @@ def pull_product_information(set_number: str) -> pl.DataFrame:
129126
if not is_card(card):
130127
continue
131128

129+
# Skip ball pattern variants (unique to Prismatic Evolutions)
130+
card_name = card.get("name", "")
131+
if "(Poke Ball Pattern)" in card_name or "(Master Ball Pattern)" in card_name:
132+
continue
133+
132134
card_info = {
133135
"product_id": card["productId"],
134-
"name": extract_card_name(card["name"]),
136+
"name": extract_card_name(card_name),
135137
"card_number": get_card_number(card),
136138
"market_price": price_dict.get(card["productId"]),
137139
}

0 commit comments

Comments
 (0)