Build the scripts for my website Pokemon TCG Pocket Data (GitHub).
A web crawler to crawl Pokemon cards names from Pokemon-Zone.
Important
The script is design for python below 3.13.
- Python < 3.13
- async_playwright
- pandas
--exorp: Expansion (e) or pack key (p).--set: Set code to crawl (A1, A2, etc.).--pack-key: Pack key to crawl (AN001_0020_00_000, etc.).--pack-name: Pack name to crawl (Charizard, etc.).
py -3.11 pokemon_crawler.py \
--exorp e \
--set A1 \
--pack-key AN001_0020_00_000 \
--pack-name CharizardA script that renames all images in a folder based on an Excel file. The script reads the image name from the Excel file and appends the folder name to the end of each image filename.
The Excel files can be obtained using the script pokemon_crawler.py—only need to crawl the expansion.
PK_10_000110_00 -> cPK_10_000110_00_NAZONOKUSA_C_{folder_name}Note
The images is expected to be downloaded from Google Drive
- pandas
--folder(Multiple): Folder path to rename images, separate by space.--excel-file: Excel file path.--dry-run(Default): Enable dry run mode (no changes).--no-dry-run: Disable dry run mode (execute changes).
py rename_images.py \
--folder "path/to/folder" "path/to/folder" \
--excel-file "path/to/excel/file"A script that generates card JSON from images and Excel files. It matches each image to the corresponding Excel file, ensuring no duplicate cards appear within the same pack (though duplicates can exist across different packs). The script uses icon list to determine card type in the specific position (top right) in the image.
- pandas
--image-folder: Folder path to images.--excel-files(Multiple): Excel file paths, separate by space.--output-name: Output file name.
py generate_card_json.py \
--image-folder "path/to/image/folder" \
--excel-files "path/to/excel/file" "path/to/excel/file" \
--output-name "path/to/output/file"A script that generates special card JSON from images and Excel files (duplicate cards JSON). The script uses an icon list to determine:
- Card type from the top-right position in the image
- Card fight energy from the bottom-left position
- Card weakness from the bottom-right position
- Whether the card is a trainer or tool from the color of the top-left position
- pandas
- numpy
- cv2
--image-folder: Folder path to images.--duplicate-list: Duplicate list file path.--output-name: Output file name.
py generate_special_card_json.py \
--image-folder "path/to/image/folder" \
--duplicate-list "path/to/duplicate/list" \
--output-name "path/to/output/file"