This is the Pokémon TCG SDK Python implementation. It is a wrapper around the Pokémon TCG API of pokemontcg.io.
Python 3 is currently the only supported version for the sdk. More specifically, the package was developed using Python 3.9.
Using pip:
pip install pokemontcgsdk
Import (Card and Set will be most used)
from pokemontcgsdk import Card
from pokemontcgsdk import Set
from pokemontcgsdk import Type
from pokemontcgsdk import Supertype
from pokemontcgsdk import Subtype
from pokemontcgsdk import Rarity
In order to set an API Key from https://dev.pokemontcg.io, just set the environment variable:
export POKEMONTCG_IO_API_KEY='12345678-1234-1234-1234-123456789ABC'
or configure the static RestClient instance
from pokemontcgsdk import RestClient
RestClient.configure('12345678-1234-1234-1234-123456789ABC')
Card
Set
Type
Supertype
Subtype
Rarity
abilities
artist
ancientTrait
attacks
convertedRetreatCost
evolvesFrom
flavorText
hp
id
images
legalities
regulationMark
name
nationalPokedexNumbers
number
rarity
resistances
retreatCost
rules
set
subtypes
supertype
tcgplayer
types
weaknesses
id
images
legalities
name
printedTotal
ptcgoCode
releaseDate
series
total
updatedAt
card = Card.find('xy1-1')
cards = Card.where(q='set.name:generations supertype:pokemon')
cards = Card.all()
cards = Card.where(page=5, pageSize=250)
set = Set.find('base1')
sets = Set.where(q='legalities.standard:legal')
sets = Set.all()
types = Type.all()
subtypes = Subtype.all()
supertypes = Supertype.all()
rarities = Rarity.all()
- Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-python/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Setup the development environment (
make setup
) - Make, Develop, and commit your changes! (
git commit -am 'Add some feature'
) - Run tests! (
make test
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
make test