Skip to content

Latest commit

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pygo_API

Python Module to access the YGOProDeck API

Instalation

pip install pygo-API

YGOProDeck Params and API queries

API queries:

queryusageparams
nameget card by stringstring
archetypeget cards of specific archetypestring
levelget cards of specific levelint
atributeget cards of specific atributestring
banlistonly returns if card is on chosen banliststring
cardsetget cards from declared setstring
fnamesearch card by partial namestring
raceget cards of specific attributestring
formatget cards from chosen fromatstring
linkmarkerfilter by link markersstring
miscadd YGOProDeck specific data to JSON dictyes
stapleshow cards considered stapleyes
startdateexclude cards relesed before set dateyyyy-mm-dd
enddateexclude cards relesed after set dateyyyy-mm-dd
typefilter by card type e.g. spell, counter trapstring
languageget output in specified languagestring

Params

typeracelanguage
Effect MonsterAquafr
Flip Effect MonsterBeastde
Flip Tuner Effect MonsterBeast-Warriorit
Gemini MonsterCreator-Godpt
Normal MonsterCybers
Normal Tuner MonsterDinosaur
Pendulum Effect MonsterDivine-Beast
Pendulum Effect Ritual MonsterDragon
Pendulum Flip Effect MonsterFairy
Pendulum Normal MonsterFiend
Pendulum Tuner Effect MonsterFish
Ritual Effect MonsterInsect
Ritual MonsterMachine
Spell CardPlant
Spirit MonsterPsychic
Toon MonsterPyro
Trap CardReptile
Tuner MonsterRock
Union Effect MonsterSea Serpent
Fusion MonsterSpellcaster
Link MonsterThunder
Pendulum Effect Fusion MonsterWarrior
Synchro MonsterWinged Beast
Synchro Pendulum Effect MonsterWyrm
Synchro Tuner MonsterZombie
XYZ MonsterNormal
XYZ Pendulum Effect MonsterField
Skill CardEquip
TokenContinuous
Quick-Play
Ritual
Normal
Continuous
Counter

Usage

importpygo_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".

print(pygo_API.Card().random())

prints a random card dict

Examples

Get All Cards

tcg=pygo_API.Card().getData()
print(tcg)

Warning: The output is a JSON dict with roughly 670,000 lines, so be careful with generic API requests.

Get Specific Link Monsters

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.

Get All Staple Cards

staples=pygo_API.Card(staple="yes").getData()
print(staples)

Prints every card considered a staple by YGOProDeck

Get Cards from TCG Banlist within a Date Range

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

Search then sort cards by name

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.

Get Card Text

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

Method arguments

Filter Returned Data

.getData(fields=["name"])

The "fields" argument takes only arrays as input and then lets the method return only the keys of that name.

Sort Output

pygo_API.Card(sort="name")

The "sort" argument sorts your output from A-Z with the given dict key.

Save Image locally

pygo_API.Image(save=True)

If the "save" argument is set to "True" the method will save the Image in a local directory as a .jpg file.

About

Simple Python module to utilize the YGOProDeck API

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages