A simple tool to utilize the YGOProDeck API as a Python module
Project description
pygo_API
Python Module to access the YGOProDeck API
Params and API queries
API queries:
query | usage | params |
---|---|---|
name | get card by string | string |
archetype | get cards of specific archetype | string |
level | get cards of specific level | int |
atribute | get cards of specific atribute | string |
banlist | only returns if card is on chosen banlist | string |
cardset | get cards from declared set | string |
fname | search card by partial name | string |
race | get cards of specific attribute | string |
format | get cards from chosen fromat | string |
linkmarker | filter by link markers | string |
misc | add YGOProDeck specific data to JSON dict | yes |
staple | show cards considered staple | yes |
startdate | exclude cards relesed before set date | yyyy-mm-dd |
enddate | exclude cards relesed after set date | yyyy-mm-dd |
type | filter by card type e.g. spell, counter trap | string |
language | get output in specified language | string |
Params
type | race | language |
---|---|---|
Effect Monster | Aqua | fr |
Flip Effect Monster | Beast | de |
Flip Tuner Effect Monster | Beast-Warrior | it |
Gemini Monster | Creator-God | pt |
Normal Monster | Cybers | |
Normal Tuner Monster | Dinosaur | |
Pendulum Effect Monster | Divine-Beast | |
Pendulum Effect Ritual Monster | Dragon | |
Pendulum Flip Effect Monster | Fairy | |
Pendulum Normal Monster | Fiend | |
Pendulum Tuner Effect Monster | Fish | |
Ritual Effect Monster | Insect | |
Ritual Monster | Machine | |
Spell Card | Plant | |
Spirit Monster | Psychic | |
Toon Monster | Pyro | |
Trap Card | Reptile | |
Tuner Monster | Rock | |
Union Effect Monster | Sea Serpent | |
Fusion Monster | Spellcaster | |
Link Monster | Thunder | |
Pendulum Effect Fusion Monster | Warrior | |
Synchro Monster | Winged Beast | |
Synchro Pendulum Effect Monster | Wyrm | |
Synchro Tuner Monster | Zombie | |
XYZ Monster | Normal | |
XYZ Pendulum Effect Monster | Field | |
Skill Card | Equip | |
Token | Continuous | |
Quick-Play | ||
Ritual | ||
Normal | ||
Continuous | ||
Counter |
Usage
import pygo_API
use to include the module
image = pygo_API.Image("normal", "kuriboh").getImage()
Saves the image of "Kuriboh" in the variable image as well as caching it.
print(pygo_API.Card(name="kuriboh").getData())
Prints the entire data of "kuriboh".
Examples
tcg = pygo_API.Card().getData()
print(tcg)
Print all Cards
WARNING
The above output is a JSON dict with roughly 670000 lines so be carefull with generic API requests
dragons = pygo_API.Card(fname="dragon", linkmarker="bottom,top,left").getData()
Saves all Linkmonsters with "dragon" in their name and Linkarrows pointing to the bottom, top and left to the "dragons" variable.
staples = pygo_API.Card(staple="yes").getData()
print(staples)
Prints every card considered a staple by YGOProDeck
tcg = pygo_API.Card(banlist="tcg", startdate="2020-01-01", enddate="2024-01-01").getData()
Get all cards added to the tcg banlist between first of january 2020 and the first of january 2024
tcg = pygo_API.Card(fname="snake-eye", sort="name").getData(fields=["name", "id"])
print(tcg)
Print all "snake-eye" cards sortet by name and only show their name and id.
print(pygo_API.Card(name="kuriboh").getData(fields=["desc"]))
Print out the card text of kuriboh
Caching
Every API request is cached for the duration of the program or script.
Alternatavly you can use:
pygo_API.Cache().clear_cache()
to clear the cache mid code.
The cachfile is stored as the URL encrypted to SHA-256
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pygo_api-0.1.0.tar.gz
.
File metadata
- Download URL: pygo_api-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7dca3f07f4074dbd22b0f055e01ec9b3434796dcc8abca7c27ec7b0ab54811 |
|
MD5 | cba7c39ad6fa2285ff8cf941f3d9f193 |
|
BLAKE2b-256 | 621842e5e7b084dc6a9cc0e235a33a4d1d87788763e2cc7711c3974c1e3a103a |