{"id":15010093,"url":"https://github.com/kociamber/ex_owm","last_synced_at":"2025-04-09T17:54:04.482Z","repository":{"id":27907151,"uuid":"107987462","full_name":"Kociamber/ex_owm","owner":"Kociamber","description":"Elixir wrapper around Open Weather Map API","archived":false,"fork":false,"pushed_at":"2024-11-25T11:23:23.000Z","size":14400,"stargazers_count":8,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T20:01:37.621Z","etag":null,"topics":["elixir","mix","openweathermap","otp","owm","weather","weather-forecast"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kociamber.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-23T13:39:58.000Z","updated_at":"2025-03-02T21:39:52.000Z","dependencies_parsed_at":"2024-09-28T17:20:46.734Z","dependency_job_id":"83afa5b1-085f-4d55-8e52-6c3ac3e5a5ae","html_url":"https://github.com/Kociamber/ex_owm","commit_stats":{"total_commits":94,"total_committers":3,"mean_commits":"31.333333333333332","dds":"0.25531914893617025","last_synced_commit":"87085438ac68ffad07d05e2838ee4c833f6f6603"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kociamber%2Fex_owm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kociamber%2Fex_owm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kociamber%2Fex_owm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kociamber%2Fex_owm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kociamber","download_url":"https://codeload.github.com/Kociamber/ex_owm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248083558,"owners_count":21045122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","mix","openweathermap","otp","owm","weather","weather-forecast"],"created_at":"2024-09-24T19:30:05.524Z","updated_at":"2025-04-09T17:54:04.461Z","avatar_url":"https://github.com/Kociamber.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExOwm\n\n[![Hex Version](https://img.shields.io/hexpm/v/ex_owm.svg)](https://hex.pm/packages/ex_owm)\n[![Hex Docs](https://img.shields.io/badge/docs-hexpm-blue.svg)](https://hexdocs.pm/ex_owm/)\n[![License](https://img.shields.io/hexpm/l/ex_owm.svg)](https://github.com/kociamber/ex_owm/blob/master/LICENSE)\n[![Total Download](https://img.shields.io/hexpm/dt/ex_owm.svg)](https://hex.pm/packages/ex_owm)\n[![Last Updated](https://img.shields.io/github/last-commit/kociamber/ex_owm.svg)](https://github.com/kociamber/ex_owm/commits/master)\n\n**Fast [Open Weather Map](http://openweathermap.org/technology) API client for Elixir applications.**\n\n## Installation\n\nAdd ExOwm as a dependency to your `mix.exs` file:\n\n```elixir\ndefp deps() do\n  [\n    {:ex_owm, \"~\u003e 1.3.1\"}\n  ]\nend\n```\n\n## Upgrade from 1.0.X\n\n**Please re-factor** your configuration as the module naming (specifically the order) has slightly changed. Use the configuration below:\n\n## Configuration\n\nTo use OWM APIs, you need to [register](https://home.openweathermap.org/users/sign_up) for an account (free plan is available) and obtain an API key. After obtaining the key, set the environment variable OWM_API_KEY to your API key.\n\nIf you are using this application as a dependency in your project, add the following configuration to your `config/config.exs` file:\n\n```elixir\nconfig :ex_owm, api_key: System.get_env(\"OWM_API_KEY\")\n```\n\n..and you are ready to go!\n\n## Basic Usage\n\nExOwm currently handles the following main OpenWeatherMap [APIs](http://openweathermap.org/api):\n\n*   [Current weather data](http://openweathermap.org/current)\n*   [One Call API](https://openweathermap.org/api/one-call-api)\n*   [One Call API History](https://openweathermap.org/api/one-call-api#history)\n*   [5 day / 3 hour forecast](http://openweathermap.org/forecast5)\n*   [1 - 16 day / daily forecast](http://openweathermap.org/forecast16)\n\nPlease note that with a standard (free) license/API key, you may be limited in the number of requests per minute and may not have access to the 1 - 16 day/daily forecast. Please refer to OpenWeatherMap [pricing plans](http://openweathermap.org/price) for more details..\n\nThere are three main public interface functions for each API, accepting the same set of two parameters: a list of location maps and a keyword list of options.\n\nSample API calls:\n\n```elixir\nExOwm.get_current_weather([%{city: \"Warsaw\"}, %{city: \"London\", country_code: \"uk\"}], units: :metric, lang: :pl)\n[{:ok, %{WARSAW_DATA}}, {:ok, %{LONDON_DATA}}]\n\nExOwm.get_five_day_forecast([%{city: \"Warsaw\"}, %{city: \"London\", country_code: \"uk\"}], units: :metric, lang: :pl)\n[{:ok, %{WARSAW_DATA}}, {:ok, %{LONDON_DATA}}]\n\nExOwm.get_sixteen_day_forecast([%{city: \"Warsaw\"}, %{city: \"unknown City Name\", country_code: \"uk\"}], units: :metric, lang: :pl, cnt: 16)\n[{:ok, %{WARSAW_DATA}}, {:error, :not_found, %{\"cod\" =\u003e \"404\", \"message\" =\u003e \"city not found\"}}]\n\nyesterday = DateTime.utc_now() |\u003e DateTime.add(24 * 60 * 60 * -1, :second) |\u003e DateTime.to_unix()\nExOwm.get_historical_weather([%{lat: 52.374031, lon: 4.88969, dt: yesterday}])\n[{:ok, %{CITY_DATA}}]\n\n```\n\nFor more details, refer to the official [docs](https://hexdocs.pm/ex_owm/readme.html).\n\n## Overview\n\nExOwm utilizes some cool features such as:\n\n*   concurrent API calls\n*   super fast generational caching\n*   access to **main** [OWM APIs](http://openweathermap.org/api)!\n\nEach location entry in the list spawns a separate task (Elixir worker process) to check whether the request has been made within a specified time interval. If it has, the result is fetched from the cache. Otherwise, an API query is sent, the result is cached, and the data is returned.\n\n## Running local tests\n\nSince all the tests are based on OWM API calls, they are disabled by default. To enable them, please remove `:api_based_test` from the `test/test_helper.exs file`.\n\n## To do\n\n*   Add remaining OWM APIs (including One Call API 3.0)\n\n## License\n\nThis project is MIT licensed. Please see the [`LICENSE.md`](https://github.com/Kociamber/ex_owm/blob/master/LICENSE.md) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkociamber%2Fex_owm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkociamber%2Fex_owm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkociamber%2Fex_owm/lists"}