/forecastr

Forecastr, the Elixir way to check the weather forecast

Primary LanguageElixirApache License 2.0Apache-2.0

Forecastr Build Status Package Version License

Forecastr is an open source Weather API wrapper for OpenWeatherMap.

Forecastr is an Elixir flavour of http://wttr.in that talks directly to OpenWeatherMap. Aim of the project is to provide a website similar to wttr.in written entirely in elixir

Project status: initial. (very pre-alphaish)

Installation

If available in Hex, the package can be installed by adding forecastr to your list of dependencies in mix.exs:

def deps do
  [
    {:forecastr, "~> 0.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/forecastr.

NOTE If you want to play with this project you have to obtain an api key from http://openweathermap.org/ and:

export OWM_API_KEY=YOUR_API_KEY

Also put in your config/config.exs

config :forecastr,
  appid: System.get_env("OWM_API_KEY"),
  backend: Forecastr.OWM,
  # 10 minutes by default per OWM policy
  ttl: 10 * 60_000

Samples of output for today's forecast

Forecastr.forecast(:today, "lima", %{units: :metric}, Forecastr.Renderer.PNG)

today berlin

Sample output for 5 days:

in 5 days

"All the ducks are swimming in the water Fal de ral de ral do" (Lemon Jelly cit.)

duck with sunglasses

TODO

  • Travis
  • Tests! (reached ~80%, good enough for now ™, however if someone feels like to add more.. ;))
  • Correct ASCII Art for the renderers that supports that (In progress)
  • PNG Renderer with transparency (In progress)
  • JSON renderer (In progress)
  • Integrate https://forecast.io as a backend?

Thank yous