Pokerap v0.1.1 Pokerap.Ez

Helper functions to make pokemon searching more intuitve “get what I mean” instead of the almost firehose-esk data from the API

Summary

Functions

Returns a tuple containg status, and a “simple” evolution chain in list form

Returns a tuple containing request status, and map of flavor texts

Gets map of pokedex style descriptions

Returns a tuple containing request status, and map of images

Gets map of images

Returns a tuple containing request status, and list of possible moves a Pokemon can have/learn

Returns a list of possible moves a Pokemon can have/learn

Returns a tuple containing request status, and list of Pokemon types

Gets a list of types per pokemon

Functions

evolution(name)

Returns a tuple containg status, and a “simple” evolution chain in list form

This is a simpilifed combination of the chain /pokemon-species into /evolution-chain. /evolution-chain only takes in a numerical id of the evolution chain, that you can only get from /pokemon-species (What? You don’t know that Garbodor's evolution chain ID is 290 ?), so having the ability to just pass in a string for name is much easier.

Example

iex> Pokerap.Ez.evolution("garbodor")
{:ok, ["trubbish", ["garbodor"]]}
flavor_text(name)

Returns a tuple containing request status, and map of flavor texts.

This data is found inside of the /pokemon endpoint (Pokerap.pokemon/1) but is nested somewhat deeply.

Will return in the language set in config under config :pokerap, language:. Defaults to “en”. See Readme for more details on this function.

Example

iex> Pokerap.Ez.flavor_text("bidoof")
{:ok,
%{"alpha-sapphire" => "It constantly gnaws on logs and rocks to whittle\ndown its front teeth. It nests alongside water.",
"black" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"black-2" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"diamond" => "With nerves of steel, nothing can\nperturb it. It is more agile and\nactive than it appears.",
"heartgold" => "It lives in groups by the water. \nIt chews up boulders and trees\naround its nest with its incisors.",
"omega-ruby" => "With nerves of steel, nothing can perturb it. It is\nmore agile and active than it appears.",
"pearl" => "It constantly gnaws on logs and\nrocks to whittle down its front\nteeth. It nests alongside water.",
"platinum" => "A comparison revealed that\nBIDOOF’s front teeth grow at\nthe same rate as RATTATA’s.",
"soulsilver" => "It lives in groups by the water. \nIt chews up boulders and trees\naround its nest with its incisors.",
"white" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"white-2" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"x" => "With nerves of steel, nothing can perturb it. It is\nmore agile and active than it appears.",
"y" => "It constantly gnaws on logs and rocks to whittle\ndown its front teeth. It nests alongside water."}}
flavor_text!(name)

Gets map of pokedex style descriptions.

Returns map of flavor texts. Raises exceptions upon error. ! version of Pokerap.Ez.flavor_text/1

Example

iex> Pokerap.Ez.flavor_text!("bidoof")
%{"alpha-sapphire" => "It constantly gnaws on logs and rocks to whittle\ndown its front teeth. It nests alongside water.",
"black" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"black-2" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"diamond" => "With nerves of steel, nothing can\nperturb it. It is more agile and\nactive than it appears.",
"heartgold" => "It lives in groups by the water. \nIt chews up boulders and trees\naround its nest with its incisors.",
"omega-ruby" => "With nerves of steel, nothing can perturb it. It is\nmore agile and active than it appears.",
"pearl" => "It constantly gnaws on logs and\nrocks to whittle down its front\nteeth. It nests alongside water.",
"platinum" => "A comparison revealed that\nBIDOOF’s front teeth grow at\nthe same rate as RATTATA’s.",
"soulsilver" => "It lives in groups by the water. \nIt chews up boulders and trees\naround its nest with its incisors.",
"white" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"white-2" => "A comparison revealed that\nBidoof’s front teeth grow at\nthe same rate as Rattata’s.",
"x" => "With nerves of steel, nothing can perturb it. It is\nmore agile and active than it appears.",
"y" => "It constantly gnaws on logs and rocks to whittle\ndown its front teeth. It nests alongside water."}
images(name)

Returns a tuple containing request status, and map of images.

This data is found inside of the /pokemon endpoint (Pokerap.pokemon/1) but is nested somewhat deeply.

Example

iex> Pokerap.Ez.images("poliwhirl")
{:ok,
%{"back_default" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/61.png",
"back_female" => nil,
"back_shiny" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/61.png",
"back_shiny_female" => nil,
"front_default" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/61.png",
"front_female" => nil,
"front_shiny" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/61.png",
"front_shiny_female" => nil}}
images!(name)

Gets map of images.

Returns map of images. Raises exceptions upon error. ! version of Pokerap.Ez.images/1

Example

iex> Pokerap.Ez.images!("poliwhirl")
%{"back_default" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/61.png",
"back_female" => nil,
"back_shiny" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/61.png",
"back_shiny_female" => nil,
"front_default" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/61.png",
"front_female" => nil,
"front_shiny" => "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/61.png",
"front_shiny_female" => nil}
moves(name)

Returns a tuple containing request status, and list of possible moves a Pokemon can have/learn.

Returns “simple” list of ALL moves a Pokemon can have/learn

Example

iex> Pokerap.Ez.moves("caterpie")
{:ok, ["tackle", "string-shot", "snore", "bug-bite", "electroweb"]}

Be advised, Some pokemon have very long move sets

moves!(name)

Returns a list of possible moves a Pokemon can have/learn.

Returns “simple” list of ALL moves a Pokemon can have/learn.

Raises exceptions upon error. ! version of Pokerap.Ez.moves/1

Example

iex> Pokerap.Ez.moves!("caterpie")
["tackle", "string-shot", "snore", "bug-bite", "electroweb"]

Be advised, Some pokemon have very long move sets

types(name)

Returns a tuple containing request status, and list of Pokemon types.

This data is found inside of the /pokemon endpoint (Pokerap.pokemon/1) but is nested somewhat deeply.

Example

iex(1)> Pokerap.Ez.types("rotom")
{:ok, ["ghost", "electric"]}
types!(name)

Gets a list of types per pokemon

Returns list. Raises exceptions upon error. ! version of Pokerap.Ez.types/1

Example

iex> Pokerap.Ez.types!("rotom")
["ghost", "electric"]