[Unmaintained] An API of Ice and Fire client for Elixir
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.editorconfig
.gitattributes
.gitignore
.travis.yml
license
mix.exs
mix.lock
readme.md

readme.md

maester

An API of Ice and Fire client for Elixir

No Maintenance Intended

This project is unmaintained: I have no interest in maintaining it any more. If you want to take over, let me know at juan@juansoto.me.

Install

In your mix.exs:

defp deps do
  [
    { :maester, "~> 1.0.0" }
  ]
end

Then run mix deps.get.

Usage

Check out the fancy Hexdocs here.

First of all, add Maester to the application function in your mix.exs:

def application do
  [applications: [:logger, :maester]]
end

You got three modules under Maester: Book, Character, House, and Request. The first three allow you get the respective resources with a by_id and all functions. all takes it optional filters. See the API documentation for possible filters and pass them in as a map.

Request exposes a make function that allows you to write any query and a filter map. The other modules use it under the hood.

In case of an error, you will get an {:error, message} tuple.

For pagination, you can use the API's pagination options as filters, though if you need to find a specific item it's better to use the other filters.

Examples

Getting all characters who are female:

Maester.Character.all(%{:gender => "female"})

Getting a house by id:

Maester.House.by_id(378)

Getting the second page of characters:

Maester.Character.all(%{:page => 2})

You get the idea.

License

MIT © Juan Soto