{"id":24645539,"url":"https://github.com/crazycapivara/owmr","last_synced_at":"2025-06-27T00:07:11.257Z","repository":{"id":56936595,"uuid":"75488937","full_name":"crazycapivara/owmr","owner":"crazycapivara","description":"An R Interface to OpenWeatherMap","archived":false,"fork":false,"pushed_at":"2020-06-18T19:25:33.000Z","size":6298,"stargazers_count":26,"open_issues_count":6,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T20:48:01.042Z","etag":null,"topics":["openweathermap","r","weather","weather-data"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazycapivara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-03T17:26:20.000Z","updated_at":"2023-03-06T22:57:12.000Z","dependencies_parsed_at":"2022-08-21T07:20:41.986Z","dependency_job_id":null,"html_url":"https://github.com/crazycapivara/owmr","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/crazycapivara/owmr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazycapivara%2Fowmr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazycapivara%2Fowmr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazycapivara%2Fowmr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazycapivara%2Fowmr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazycapivara","download_url":"https://codeload.github.com/crazycapivara/owmr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazycapivara%2Fowmr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260091103,"owners_count":22957319,"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":["openweathermap","r","weather","weather-data"],"created_at":"2025-01-25T14:15:45.227Z","updated_at":"2025-06-27T00:07:11.235Z","avatar_url":"https://github.com/crazycapivara.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"An R Interface to OpenWeatherMap\n================\n\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/owmr)](https://cran.r-project.org/package=owmr)\n\n`owmr` accesses **OpenWeatherMap's** API, a service providing weather data in the past, in the future and now and furthermore, serving weather map layers usable in frameworks like `leaflet`. In order to access its API you have to sign up for an API key at\n\n-   \u003chttps://openweathermap.org\u003e\n\nBuilds\n------\n\n**master**\n\n[![Travis-CI Build Status](https://travis-ci.org/crazycapivara/owmr.svg?branch=master)](https://travis-ci.org/crazycapivara/owmr)\n\n**develop**\n\n[![Travis-CI Build Status](https://travis-ci.org/crazycapivara/owmr.svg?branch=develop)](https://travis-ci.org/crazycapivara/owmr)\n\nInstallation\n------------\n\n``` r\n# stable\ninstall.packages(\"owmr\")\n\n# unstable\ndevtools::install_github(\"crazycapivara/owmr\")\n\n# bleeding edge\ndevtools::install_github(\"crazycapivara/owmr\", ref = \"develop\")\n```\n\nIntroduction\n------------\n\nSee **OpenWeatherMap's** API documentation for optional parameters, which can be passed to all functions fetching weather data via the `...` parameter in R\n\n-   \u003chttps://openweathermap.org/api/\u003e\n\n### Setup\n\n``` r\nlibrary(owmr)\n\n# first of all you have to set up your api key\nowmr_settings(\"your_api_key\")\n\n# or store it in an environment variable called OWM_API_KEY (recommended)\nSys.setenv(OWM_API_KEY = \"your_api_key\") # if not set globally\n```\n\n### Usage\n\n``` r\n# get current weather data by city name\n(res \u003c- get_current(\"London\", units = \"metric\") %\u003e%\n  owmr_as_tibble()) %\u003e% names()\n```\n\n    ##  [1] \"dt_txt\"              \"temp\"                \"pressure\"           \n    ##  [4] \"humidity\"            \"temp_min\"            \"temp_max\"           \n    ##  [7] \"weather_id\"          \"weather_main\"        \"weather_description\"\n    ## [10] \"weather_icon\"        \"wind_speed\"          \"wind_deg\"           \n    ## [13] \"clouds_all\"          \"dt_sunrise_txt\"      \"dt_sunset_txt\"\n\n``` r\nres[, 1:6]\n```\n\n    ## # A tibble: 1 x 6\n    ##   dt_txt               temp pressure humidity temp_min temp_max\n    ##   \u003cchr\u003e               \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e\n    ## 1 2018-10-28 20:50:00  4.22     1017       81        3        6\n\n``` r\n# ... by city id\n(rio \u003c- search_city_list(\"Rio de Janeiro\")) %\u003e%\n  as.list()\n```\n\n    ## $id\n    ## [1] 3451190\n    ## \n    ## $nm\n    ## [1] \"Rio de Janeiro\"\n    ## \n    ## $lat\n    ## [1] -22.90278\n    ## \n    ## $lon\n    ## [1] -43.2075\n    ## \n    ## $countryCode\n    ## [1] \"BR\"\n\n``` r\nget_current(rio$id, units = \"metric\") %\u003e%\n  owmr_as_tibble() %\u003e% .[, 1:6]\n```\n\n    ## # A tibble: 1 x 6\n    ##   dt_txt               temp pressure humidity temp_min temp_max\n    ##   \u003cchr\u003e               \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e\n    ## 1 2018-10-28 21:00:00  23.2     1014       64       23       24\n\n``` r\n# get current weather data for cities around geo point\nres \u003c- find_cities_by_geo_point(\n  lat = rio$lat,\n  lon = rio$lon,\n  cnt = 5,\n  units = \"metric\"\n) %\u003e% owmr_as_tibble()\n\nidx \u003c- c(names(res[1:6]), \"name\")\nres[, idx]\n```\n\n    ## # A tibble: 5 x 7\n    ##   dt_txt            temp pressure humidity temp_min temp_max name         \n    ##   \u003cchr\u003e            \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e \u003cchr\u003e        \n    ## 1 2018-10-28 21:0…  23.2     1014       64       23       24 Rio de Janei…\n    ## 2 2018-10-28 21:0…  23.2     1014       64       23       24 São Cristóvão\n    ## 3 2018-10-28 21:0…  23.2     1014       69       23       24 Botafogo     \n    ## 4 2018-10-28 21:0…  23.2     1014       69       23       24 Pavão-Pavaoz…\n    ## 5 2018-10-28 21:0…  23.2     1014       64       23       24 Vila Joaniza\n\n``` r\n# get forecast\nforecast \u003c- get_forecast(\"London\", units = \"metric\") %\u003e%\n  owmr_as_tibble()\n\nforecast[, 1:6]\n```\n\n    ## # A tibble: 40 x 6\n    ##    dt_txt               temp pressure humidity temp_min temp_max\n    ##    \u003cchr\u003e               \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e\n    ##  1 2018-10-28 21:00:00  2.76    1023.       71     2.76     4.22\n    ##  2 2018-10-29 00:00:00  1.64    1021.       90     1.64     2.73\n    ##  3 2018-10-29 03:00:00  2.54    1019.       99     2.54     3.27\n    ##  4 2018-10-29 06:00:00  1.64    1018.       94     1.64     2   \n    ##  5 2018-10-29 09:00:00  4.65    1016.       84     4.65     4.65\n    ##  6 2018-10-29 12:00:00  8.44    1013.       77     8.44     8.44\n    ##  7 2018-10-29 15:00:00  8.47    1010.       70     8.47     8.47\n    ##  8 2018-10-29 18:00:00  5.96    1008.       76     5.96     5.96\n    ##  9 2018-10-29 21:00:00  3.57    1005.       87     3.57     3.57\n    ## 10 2018-10-30 00:00:00  3.07    1003.       97     3.07     3.07\n    ## # ... with 30 more rows\n\n``` r\n# apply funcs to some columns\nfuncs \u003c- list(\n  temp = round,\n  wind_speed = round\n)\nforecast %\u003c\u003e% parse_columns(funcs)\n\n# do some templating ...\n(\"{{dt_txt}}h {{temp}}°C, {{wind_speed}} m/s\" %$$%\n  forecast) %\u003e% head(10)\n```\n\n    ##  [1] \"2018-10-28 21:00:00h 3°C, 5 m/s\" \"2018-10-29 00:00:00h 2°C, 4 m/s\"\n    ##  [3] \"2018-10-29 03:00:00h 3°C, 4 m/s\" \"2018-10-29 06:00:00h 2°C, 4 m/s\"\n    ##  [5] \"2018-10-29 09:00:00h 5°C, 3 m/s\" \"2018-10-29 12:00:00h 8°C, 4 m/s\"\n    ##  [7] \"2018-10-29 15:00:00h 8°C, 5 m/s\" \"2018-10-29 18:00:00h 6°C, 4 m/s\"\n    ##  [9] \"2018-10-29 21:00:00h 4°C, 4 m/s\" \"2018-10-30 00:00:00h 3°C, 4 m/s\"\n\nDocumentation\n-------------\n\n-   \u003chttps://crazycapivara.github.io/owmr/\u003e\n\nor type\n\n``` r\n?owmr\n```\n\nRun tests\n---------\n\n``` r\ndevtools::test()\n```\n\n    ## Loading owmr\n\n    ## owmr 0.7.4\n    ##    another crazy way to talk to OpenWeatherMap's API\n    ##    Documentation: type ?owmr or https://crazycapivara.github.io/owmr/\n    ##    Issues, notes and bleeding edge: https://github.com/crazycapivara/owmr/\n\n    ## Testing owmr\n\n    ## city list: ..\n    ## mock httr::GET current: ....\n    ## current weather data for multiple cities: ......\n    ## current weather data: ........\n    ## _DEPRECATED: W.\n    ## mock httr::GET forecast: ......\n    ## parse columns: ..\n    ## render operator: ...\n    ## tidy up data: ...\n    ## \n    ## Warnings ------------------------------------------------------------------\n    ## 1. tidy up all (@test_deprecated.R#8) - 'tidy_up_' is deprecated.\n    ## Use 'owmr_as_tibble' instead.\n    ## See help(\"Deprecated\")\n    ## \n    ## DONE ======================================================================\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazycapivara%2Fowmr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazycapivara%2Fowmr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazycapivara%2Fowmr/lists"}