Pokefetch is a Python command-line application that fetches data for the Pokemon Trading Card Game based on user-defined filters.
Table of Contents
- Getting Started
- Command-Line Options
- FAQs
- License
- Filter Pokemon cards based on type, rarity, and HP range.
- Save fetched cards to a JSON file.
- Process fetched cards and generate an HTML page.
- Export metrics to Prometheus.
- Python 3.8+
- requests
- prometheus_client
Clone the repository.
git clone https://github.com/your-username/pokefetch.git
pip install -r requirements.txt
python pokefetch_src/pokefetch.py -h
Option | Data Type | Description | Default |
---|---|---|---|
-t, --type | string | Filter by Pokemon type. Available types: Normal, Fire, Water, Electric, Grass, Ice, Fighting, Poison, Ground, Flying, Psychic, Bug, Rock, Ghost, Dragon, Dark, Steel, Fairy. Use a single type (e.g., 'Fire') or multiple types separated by 'or' (e.g., 'Fire or Grass'). | FIRE OR GRASS |
-r, --rarity | string | Filter by Pokemon rarity. Available rarities: Rare Secret, Rare Rainbow, Rare Shiny GX, Rare Shining, Rare Shiny, Rare Holo VMAX, Amazing Rare, Rare Holo GX, Rare Holo LV.X, Rare Holo EX, Rare Prime, Rare ACE, Rare BREAK, Rare Prism Star, Rare Holo Star, Rare Holo, LEGEND, Promo, Rare Ultra, Uncommon, Common. Use a single rarity (e.g., 'Common') or multiple rarities separated by 'or' (e.g., 'Common or Rare'). | RARE (This means Rare Holo, Rare Prime, etc) |
-hp, --health | string | Filter by Pokemon HP range. Format: [min] to [max]. Examples: '90 to 200' (cards with HP between 90 and 200), '100 to ' (cards with HP greater than or equal to 100), ' to 200' (cards with HP less than or equal to 200). | [90 TO *] |
-l, --limit | integer | Limit the number of cards fetched per query. | 100 |
python pokefetch.py [-h] [-t TYPE] [-r RARITY] [-hp HEALTH] [-l LIMIT]
Pokemon TCG Fetch uses Prometheus to monitor various metrics related to the tool's performance. The following metrics are currently being monitored:
- pokemon_cards_output_total: Total number of Pokemon cards output to a file
- pokemon_cards_output_created: Timestamp of the last Pokemon card output to a file
- pokemon_cards_output: Number of Pokemon cards output to a file since the last time this metric was reset
- pokemon_failed_requests: Number of failed requests to the Pokemon TCG API
- pokemon_total_requests: Total number of requests made to the Pokemon TCG API
- pokemon_request_latency_seconds: Latency of requests to the Pokemon TCG API in seconds
- pokemon_request_timeout: Number of requests to the Pokemon TCG API that timed out
- backoff_factor: Current backoff factor for rate limiting
- sleep_duration: Current sleep duration for rate limiting
A: No, this application is specifically designed for the Pokemon Trading Card Game.
A: Yes, this application is provided under the MIT license, which allows for commercial use. However, keep in mind that the code is provided as-is, and the author(s) cannot be held responsible for any damages or losses resulting from its use.
A: Contributions are welcome! You can submit bug reports, feature requests, and pull requests on the project's GitHub page.
The available Pokemon types are:
Normal, Fire, Water, Electric, Grass, Ice, Fighting, Poison, Ground, Flying, Psychic, Bug, Rock, Ghost, Dragon, Dark, Steel, Fairy.
The available Pokemon rarities are:
Rare Secret, Rare Rainbow, Rare Shiny GX, Rare Shining, Rare Shiny, Rare Holo VMAX, Amazing Rare, Rare Holo GX, Rare Holo LV.X, Rare Holo EX, Rare Prime, Rare ACE,
This project is licensed under the terms of the MIT license. See LICENSE for more information.