- Add fire, water, grass, lightning, psychic energy icons
- Add card_back directory with placeholder
- Support UI display of energy types
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Derive image_path from card ID instead of raw data image_file field
- Use simplified CDN paths: /<set>/<card>.webp (e.g., a1/033-charmander.webp)
- Energy cards use basic/<type>.webp paths
- Fix undefined variable bug in transform_trainer_card
- Update tests to match new path format
- Regenerate all 382 card definitions with correct image_url fields
The converter now falls back to using the source image_url from raw
data when image_file is not available (images not downloaded locally).
- Pokemon cards: use source image_url when image_file is null
- Trainer cards: same fallback behavior
- Regenerated all 382 card definitions with image URLs
Images point to pokemon-zone.com assets for now. When we host our
own images, cards with image_file will use our CDN instead.
The source website uses <span class='energy-text energy-text--type-fire'>
to render inline energy icons. BeautifulSoup's get_text() was stripping
these spans, losing the energy type information and causing merged text
like 'Discard aEnergy' instead of 'Discard a Fire Energy'.
Changes:
- Add ENERGY_TEXT_TYPES mapping for inline energy references
- Add replace_energy_text_spans() to convert spans to text before extraction
- Add extract_effect_text() helper with proper text joining (separator=' ')
- Update parse_attack(), parse_ability(), _parse_trainer_details() to use it
- Fix JSON encoding in convert_cards.py to use UTF-8 (ensure_ascii=False)
Before: 'Discard an Energy from this Pokémon'
After: 'Discard a Fire Energy from this Pokémon'
Re-scraped all 372 cards and regenerated 382 definitions.
Scraper fixes:
- Detect fossil cards (Helix/Dome Fossil, Old Amber) as Trainer/Item cards
- Add text artifact cleaning for stripped energy icons:
- 'aEnergy' -> 'an Energy'
- 'extraEnergy' -> 'extra Energy'
- 'BenchedPokémon' -> 'Benched Pokémon'
- And 20+ other common patterns
Converter improvements:
- Add evolution chain validation to detect broken evolves_from references
- Track conversion errors and validation warnings in _index.json
- Return errors from convert_set() for better debugging
Data fixes:
- Fixed 4 fossil cards (now correctly typed as trainer/item)
- Fixed text artifacts in 46 raw card files
- Regenerated all 382 card definitions
- All evolution chains now valid
Added fix_raw_text.py utility script for batch text cleanup.
- Rename data/cards/ to data/raw/ for scraped data
- Add data/definitions/ as authoritative card data source
- Add convert_cards.py script to transform raw -> definitions
- Generate 378 card definitions (344 Pokemon, 24 Trainers, 10 Energy)
- Add CardService for loading and querying card definitions
- In-memory indexes for fast lookups by type, set, pokemon_type
- search() with multiple filter criteria
- get_all_cards() for GameEngine integration
- Add SetInfo model for set metadata
- Update Attack model with damage_display field for variable damage
- Update CardDefinition with image_path, illustrator, flavor_text
- Add 45 tests (21 converter + 24 CardService)
- Update scraper output path to data/raw/
Card data is JSON-authoritative (no database) to support offline fork goal.
- Fix is_ex detection to only match ' ex' suffix (fixes Exeggutor false positive)
- Fix trainer card detection with specific 'Trainer | Type' pattern
- Improve trainer effect text extraction from content body
- Scrape full A1 set: 286 cards
- Scrape full A1a set: 86 cards
- Total: 372 cards with images (some images failed due to rate limiting)
- Re-scraped affected cards to fix is_ex and trainer type issues
- Add --images flag to download images during scraping
- Add --download-images command to fetch images for existing card data
- Images saved to data/images/{set}/ directory
- Card JSON updated with image_file field (relative path)
- Uses Referer header for asset server compatibility
- Supports skip-if-exists for incremental downloads
- Add scrape_pokemon_pocket.py script to fetch card data from pokemon-zone.com
- Scrapes Pokemon, Trainer, and Energy cards with full metadata
- Includes image URLs for offline caching support
- Supports --set, --card, --limit, and --reindex CLI options
- Add beautifulsoup4 and requests as dev dependencies
- Create data/cards/ directory structure for card JSON files