{"id":14067904,"url":"https://github.com/hrbrmstr/darksky","last_synced_at":"2025-09-09T12:43:18.741Z","repository":{"id":56937425,"uuid":"68816496","full_name":"hrbrmstr/darksky","owner":"hrbrmstr","description":":cloud: R interface to the Dark Sky API [APPLE IS SHUTTING DOWN THE API 2022-12-31]","archived":false,"fork":false,"pushed_at":"2021-05-23T11:01:55.000Z","size":1206,"stargazers_count":83,"open_issues_count":9,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-11-20T14:46:50.833Z","etag":null,"topics":["darksky","darksky-api","darksky-api-powered","darksky-weather-api","darkskyapi","r","rstats","weatherkit"],"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/hrbrmstr.png","metadata":{"files":{"readme":"README.Rmd","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-09-21T12:52:55.000Z","updated_at":"2023-10-19T10:23:42.000Z","dependencies_parsed_at":"2022-08-21T07:20:35.365Z","dependency_job_id":null,"html_url":"https://github.com/hrbrmstr/darksky","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fdarksky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fdarksky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fdarksky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fdarksky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/darksky/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830912,"owners_count":20354848,"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":["darksky","darksky-api","darksky-api-powered","darksky-weather-api","darkskyapi","r","rstats","weatherkit"],"created_at":"2024-08-13T07:05:50.298Z","updated_at":"2025-03-16T20:31:14.082Z","avatar_url":"https://github.com/hrbrmstr.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: rmarkdown::github_document\neditor_options: \n  chunk_output_type: console\n---\n```{r include=FALSE}\nknitr::opts_chunk$set(message = FALSE, warning = FALSE, fig.retina=2)\n```\n\u003c!-- [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active)  --\u003e\n\u003c!-- [![Coverage Status](https://img.shields.io/codecov/c/github/hrbrmstr/darksky/master.svg)](https://codecov.io/github/hrbrmstr/darksky?branch=master) --\u003e\n\u003c!-- [![Build Status](https://travis-ci.org/hrbrmstr/darksky.svg?branch=master)](https://travis-ci.org/hrbrmstr/darksky) --\u003e\n\u003c!-- [![Build status](https://ci.appveyor.com/api/projects/status/gq0uxmae9ii64g6q?svg=true)](https://ci.appveyor.com/project/hrbrmstr/darksky) --\u003e\n\u003c!-- [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/darksky)](https://cran.r-project.org/package=darksky) --\u003e\n\u003c!-- ![downloads](http://cranlogs.r-pkg.org/badges/grand-total/darksky) --\u003e\n\n`darksky` : Tools to Work with the Dark Sky API\n\n- Dark Sky API Docs: https://darksky.net/dev/docs\n- Dark Sky Dev site: https://darksky.net/dev/\n\nThe following functions are implemented:\n\n- `darksky_api_key` :\tGet or set `DARKSKY_API_KEY` value\n- `get_current_forecast` : Retrieve the current forecast (for the next week)\n- `get_forecast_for` : Retrieve weather data for a specific place/time\n- `plot.darksky` : Plot method for `darksky` objects\n- `print.darksky` : A tad more human readable default printing\n\n### Installation\n\n```{r eval=FALSE}\ndevtools::install_github(\"hrbrmstr/darksky\")\n```\n\nOR\n\n```{r eval=FALSE}\ndevtools::install.packages(\"darksky\")\n```\n\n```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}\noptions(width=120)\n```\n\n### Usage\n\n```{r}\nlibrary(darksky)\nlibrary(tidyverse)\n\n# current verison\npackageVersion(\"darksky\")\n\nnow \u003c- get_current_forecast(43.2672, -70.8617)\nprint(now)\n```\n\nHistorical (using `Date` objects):\n\n```{r}\nseq(Sys.Date()-10, Sys.Date(), \"1 day\") %\u003e% \n  map(~get_forecast_for(43.2672, -70.8617, .x)) %\u003e% \n  map_df(\"hourly\") %\u003e% \n  ggplot(aes(x=time, y=temperature)) +\n  geom_line()\n```\n\n```{r}\nthen \u003c- get_forecast_for(43.2672, -70.8617, \"2013-05-06T12:00:00-0400\", add_headers=TRUE)\nprint(then)\n\n# getting data for more than one location\n\nmore_than_one \u003c- data.frame(loc=c(\"Maine\", \"Seattle\"),\n                            lat=c(43.2672, 47.6097),\n                            lon=c(70.8617, 122.3331),\n                            when=c(\"2013-05-06T12:00:00-0400\",\n                                   \"2013-05-06T12:00:00-0400\"),\n                            stringsAsFactors=FALSE)\n\nbigger_list \u003c- pmap(list(more_than_one$lat, more_than_one$lon,\n                         more_than_one$when),\n                    get_forecast_for)\nnames(bigger_list) \u003c- more_than_one$loc\n\nbigger_list$Seattle\n\nbigger_list$Maine\n\nprint(sprintf(\"You have used %s API calls.\", then$`x-forecast-api-calls`))\n\nplot(now)\n```\n\n### Test Results\n\n```{r}\nlibrary(darksky)\nlibrary(testthat)\n\ndate()\n\ntest_dir(\"tests/\")\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fdarksky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Fdarksky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fdarksky/lists"}