Fetch Yu-Gi-Oh Cards from the API Yu-Gi-Oh API then update your database using Notion API.
Requirements:
- python-dotenv==1.0.0
- requests==2.28.1
Install the required module:
pip install -r requirements.txt
Make sure to provide in the .env file your Notion API key and your database id.
The file main.py will fetch the Yu-Gi-Oh Cards. Cards can be fetch by filtering through their (we five their parser arguements):
- name : card_name
- type : card_type
- atk : card_atk
- def : card_def
- level : card_level
- race : card_race
- attribute : card_attribute
You can limit the number of cards retrieved (limit is the parser argument, default value is 10).
Here are some examples of code you can run :
- Fetch by name:
python3 main.py --card_name "Dark Magician"
- Fetch by type:
python3 main.py --card_type "Fusion Monster" --limit 20
- Fetch by attaque points:
python3 main.py --card_atk 2500 --limit 20
- Fetch by defense points:
python3 main.py --card_def 2000 --limit 20
- Fetch by level:
python3 main.py --card_level 8 --limit 20
- Fetch by race:
python3 main.py --card_race "Warrior" --limit 20