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. |
||
|---|---|---|
| .. | ||
| energy/basic | ||
| pokemon | ||
| trainer | ||
| _index.json | ||
| README.md | ||
Card Definitions (Authoritative)
These JSON files are the authoritative source for card data used by the game engine. Edit these files for gameplay changes.
Structure
definitions/
├── _index.json # Master index with all cards + set metadata
├── pokemon/
│ ├── a1/ # Pokemon from Genetic Apex
│ └── a1a/ # Pokemon from Mythical Island
├── trainer/
│ ├── a1/ # Trainers from Genetic Apex
│ └── a1a/ # Trainers from Mythical Island
└── energy/
└── basic/ # Universal basic energy cards
Generating Definitions
Definitions are generated from raw scraped data:
cd backend
python scripts/convert_cards.py
After generation, you can manually edit files for corrections or gameplay tweaks.
Schema
Each JSON file conforms to the CardDefinition Pydantic model in app/core/models/card.py.
Key fields:
id: Unique identifier (e.g., "a1-001-bulbasaur")name: Display namecard_type: "pokemon", "trainer", or "energy"set_id: Which set this card belongs to
See the model documentation for complete field descriptions.