Pokémon TCG SDK
This is the Pokémon TCG SDK Elixir implementation. It is a wrapper around the Pokémon TCG API of pokemontcg.io.
Installation
The package can be installed as:
-
Add
pokemon
to your list of dependencies inmix.exs
:def deps do [{:pokemon, "~> 1.0"}] end
-
Ensure
pokemon
is started before your application:def application do [applications: [:pokemon]] end
Heroku
If you recieve a dependency issue on heroku from this package, create an elixir_buildpac.config in the root directory of your project with the following code:
erlang_version=19.0.2
elixir_version=1.3.2
Modules
Card
Set
Type
Supertype
Subtype
Properties Per Class
Card
id
name
national_pokedex_number
image_url
subtype
supertype
ability
hp
number
artist
rarity
series
set
set_code
retreat_cost
text
types
attacks
weaknesses
resistances
Set
code
name
series
total_cards
standard_legal
release_date
Ability
name
text
Attack
cost
name
text
damage
converted_energy_cost
TypeValue
type
value
Functions Available
Find a card by id
card = Pokemon.Card.find("xy1-1")
Filter Cards via query parameters
cards = Pokemon.Card.where(set: "generations", superType: "pokemon")
Find all cards (will take awhile)
cards = Pokemon.Card.all
Get all cards, but only a specific page of data
cards = Pokemon.Card.where(page: 5, pageSize: 100)
Find a set by code
set = Pokemon.Set.find("base1")
Filter sets via query parameters
sets = Pokemon.Set.where(standardLegal: true)
Get all Sets
sets = Pokemon.Set.all
Get all Types
types = Pokemon.Type.all
Get all Subtypes
subtypes = Pokemon.Subtype.all
Get all Supertypes
supertypes = Pokemon.Supertype.all
Contributing
- Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-elixir/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request