{"id":14068213,"url":"https://github.com/rywhale/kiwisR","last_synced_at":"2025-07-30T03:32:38.166Z","repository":{"id":34291931,"uuid":"112931844","full_name":"rywhale/kiwisR","owner":"rywhale","description":"Provides a simplified method for bringing tidy data into R from KISTERS WISKI databases via KiWIS API. ","archived":false,"fork":false,"pushed_at":"2024-10-11T11:50:46.000Z","size":2299,"stargazers_count":13,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-02T17:57:01.658Z","etag":null,"topics":["api-wrapper","hydrology","hydrometrics","kisters","open-data","r","r-package","r-programming"],"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/rywhale.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-12-03T13:51:22.000Z","updated_at":"2025-03-04T19:18:28.000Z","dependencies_parsed_at":"2022-08-08T00:15:31.913Z","dependency_job_id":"ae726bbe-8598-4f5b-8d4e-cf6dcdec01d5","html_url":"https://github.com/rywhale/kiwisR","commit_stats":{"total_commits":87,"total_committers":4,"mean_commits":21.75,"dds":0.1839080459770115,"last_synced_commit":"961555ca749a6c2d92b0a280fe2e34dc5549db3a"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rywhale/kiwisR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rywhale%2FkiwisR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rywhale%2FkiwisR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rywhale%2FkiwisR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rywhale%2FkiwisR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rywhale","download_url":"https://codeload.github.com/rywhale/kiwisR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rywhale%2FkiwisR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267803984,"owners_count":24146527,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-wrapper","hydrology","hydrometrics","kisters","open-data","r","r-package","r-programming"],"created_at":"2024-08-13T07:06:01.722Z","updated_at":"2025-07-30T03:32:37.695Z","avatar_url":"https://github.com/rywhale.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n# kiwisR \u003cimg src=\"tools/readme/kiwisR_small.png\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![R-CMD-check](https://github.com/rywhale/kiwisR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rywhale/kiwisR/actions/workflows/R-CMD-check.yaml)\n[![LICENSE](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/kiwisR)](https://cran.r-project.org/package=kiwisR)\n[![CRAN\nDownload](https://cranlogs.r-pkg.org/badges/kiwisR?color=brightgreen)](https://CRAN.R-project.org/package=kiwisR)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\nA wrapper for querying [KISTERS WISKI\ndatabases](https://www.kisters.net/NA/products/wiski/) via the [KiWIS\nAPI](https://www.kisters.eu/water-weather-and-environment/). Users can\ntoggle between various databases by specifying the `hub` argument.\nCurrently, the default hubs are:\n\n- *kisters* : [KISTERS KiWIS Example\n  Server](https://kiwis.kisters.de/KiWIS/)\n- *swmc* : [Ontario Surface Water Monitoring\n  Centre](https://www.ontario.ca/page/surface-water-monitoring)\n- *quinte* : [Quinte Conservation\n  Authority](https://www.quinteconservation.ca/en/index.aspx)\n\nAll data is returned as tidy\n[tibbles](https://CRAN.R-project.org/package=tibble).\n\n## Installation\n\nYou can install `kiwisR` from CRAN:\n\n``` r\ninstall.packages('kiwisR')\n```\n\nTo install the development version of `kiwisR` you first need to install\n`devtools`.\n\n``` r\nif(!requireNamespace(\"devtools\")) install.packages(\"devtools\")\ndevtools::install_github('rywhale/kiwisR')\n```\n\nThen load the package with\n\n``` r\nlibrary(kiwisR)\n```\n\n## Usage\n\n### Get Station Information\n\nBy default, `ki_station_list()` returns a tibble containing information\nfor all available stations for the selected hub.\n\n``` r\n# With swmc as the hub\nki_station_list(hub = 'swmc')\n#\u003e # A tibble: 3,941 × 5\n#\u003e    station_name         station_no station_id station_latitude station_longitude\n#\u003e    \u003cchr\u003e                \u003cchr\u003e      \u003cchr\u003e                 \u003cdbl\u003e             \u003cdbl\u003e\n#\u003e  1 A SNOW TEMPLATE      SNOW-WLF-… 952125                 NA                NA  \n#\u003e  2 AA SNOW TEMPLATE     SNOW-WLF-… 954599                 NA                NA  \n#\u003e  3 AARON PP             SNOW-MNR-… 1346534                49.8             -92.6\n#\u003e  4 ABERDEEN             CLIM-MSC-… 121939                 45.5             -98.4\n#\u003e  5 ABITIBI CANYON       ZZSNOW-OP… 148200                 49.9             -81.6\n#\u003e  6 ABITIBI LAKE         CLIM-MNR-… 121135                 48.7             -80.1\n#\u003e  7 ABITIBI RIVER AT AB… HYDAT-04M… 136328                 49.9             -81.6\n#\u003e  8 ABITIBI RIVER AT IR… HYDAT-04M… 136304                 48.8             -80.7\n#\u003e  9 ABITIBI RIVER AT IS… HYDAT-04M… 136324                 49.6             -81.4\n#\u003e 10 Abitibi River at On… WSC-04ME0… 146775                 50.6             -81.4\n#\u003e # ℹ 3,931 more rows\n```\n\n### Get Time Series Information\n\nYou can use the `station_id` column returned using `ki_station_list()`\nto figure out which time series are available for a given station.\n\n#### One Station\n\n``` r\n# Single station_id\navailable_ts \u003c- ki_timeseries_list(\n  hub = 'swmc', \n  station_id = \"144659\"\n  )\n\navailable_ts\n#\u003e # A tibble: 223 × 6\n#\u003e    station_name station_id ts_id ts_name from                to                 \n#\u003e    \u003cchr\u003e        \u003cchr\u003e      \u003cchr\u003e \u003cchr\u003e   \u003cdttm\u003e              \u003cdttm\u003e             \n#\u003e  1 Jackson Cre… 144659     9489… Precip… 2007-06-18 20:15:00 2024-10-11 10:15:00\n#\u003e  2 Jackson Cre… 144659     1143… Precip… 2007-07-01 05:00:00 2024-11-01 05:00:00\n#\u003e  3 Jackson Cre… 144659     1143… Precip… 2007-06-18 05:00:00 2024-10-12 05:00:00\n#\u003e  4 Jackson Cre… 144659     9489… TAir.1… 2007-06-18 20:15:00 2024-10-11 10:15:00\n#\u003e  5 Jackson Cre… 144659     9489… TAir.D… 2007-06-18 05:00:00 2024-10-10 05:00:00\n#\u003e  6 Jackson Cre… 144659     9489… TAir.D… 2007-06-18 05:00:00 2024-10-10 05:00:00\n#\u003e  7 Jackson Cre… 144659     1129… TAir.6… 2007-06-19 00:00:00 2024-10-11 06:00:00\n#\u003e  8 Jackson Cre… 144659     1326… TAir.D… 2007-06-18 05:00:00 2024-10-12 05:00:00\n#\u003e  9 Jackson Cre… 144659     1326… TAir.D… 2007-06-18 05:00:00 2024-10-12 05:00:00\n#\u003e 10 Jackson Cre… 144659     9490… TWater… 2007-06-18 05:00:00 2024-10-10 05:00:00\n#\u003e # ℹ 213 more rows\n```\n\n#### Multiple Stations\n\nIf you provide a vector to `station_id`, the returned tibble will have\nall the available time series from *all* stations. They can be\ndifferentiated using the `station_name` column.\n\n``` r\n# Vector of station_ids\nmy_station_ids \u003c- c(\"144659\", \"144342\")\n\navailable_ts \u003c- ki_timeseries_list(\n  hub = 'swmc', \n  station_id = my_station_ids\n  )\n\navailable_ts\n#\u003e # A tibble: 331 × 6\n#\u003e    station_name station_id ts_id ts_name from                to                 \n#\u003e    \u003cchr\u003e        \u003cchr\u003e      \u003cchr\u003e \u003cchr\u003e   \u003cdttm\u003e              \u003cdttm\u003e             \n#\u003e  1 Oshawa Cree… 144342     1331… Precip… 2023-07-05 05:00:00 2024-08-27 00:00:00\n#\u003e  2 Oshawa Cree… 144342     9455… TWater… 2011-07-25 05:00:00 2024-10-10 05:00:00\n#\u003e  3 Oshawa Cree… 144342     9455… TWater… 2011-07-25 05:00:00 2024-10-10 05:00:00\n#\u003e  4 Oshawa Cree… 144342     9456… LVL.Mo… 2001-12-01 05:00:00 2021-12-01 05:00:00\n#\u003e  5 Oshawa Cree… 144342     9456… LVL.Ye… 2002-01-01 05:00:00 2021-01-01 05:00:00\n#\u003e  6 Oshawa Cree… 144342     1235… WWP.St… 1985-01-01 05:00:00 2025-01-01 05:00:00\n#\u003e  7 Oshawa Cree… 144342     1243… WWP.St… 1985-01-01 05:00:00 2025-01-01 05:00:00\n#\u003e  8 Oshawa Cree… 144342     9456… Q.DayM… 1986-09-01 05:00:00 2024-10-10 05:00:00\n#\u003e  9 Oshawa Cree… 144342     9456… Q.Year… 1986-01-01 05:00:00 2023-01-01 05:00:00\n#\u003e 10 Oshawa Cree… 144342     1239… WWP.St… 1985-01-01 05:00:00 2025-01-01 05:00:00\n#\u003e # ℹ 321 more rows\n```\n\n### Get Time Series Values\n\nYou can now use the `ts_id` column in the tibble produced by\n`ki_timeseries_list()` to query values for chosen time series.\n\nBy default this will return values for the past 24 hours. You can\nspecify the dates you’re interested in by setting `start_date` and\n`end_date`. These should be set as date strings with the format\n‘YYYY-mm-dd’.\n\nYou can pass either a single or multiple `ts_id`(s).\n\n#### One Time Series\n\n``` r\n# Past 24 hours\nmy_values \u003c- ki_timeseries_values(\n  hub = 'swmc', \n  ts_id = '966435042'\n  )\n#\u003e No start or end date provided, trying to return data for past 24 hours\n\nmy_values\n#\u003e # A tibble: 405 × 7\n#\u003e    Timestamp           Value ts_name ts_id     Units station_name     station_id\n#\u003e    \u003cdttm\u003e              \u003cdbl\u003e \u003cchr\u003e   \u003cchr\u003e     \u003cchr\u003e \u003cchr\u003e            \u003cchr\u003e     \n#\u003e  1 2024-10-10 00:00:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  2 2024-10-10 00:05:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  3 2024-10-10 00:10:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  4 2024-10-10 00:15:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  5 2024-10-10 00:20:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  6 2024-10-10 00:25:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  7 2024-10-10 00:30:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  8 2024-10-10 00:35:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e  9 2024-10-10 00:40:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e 10 2024-10-10 00:45:00  23.1 LVL.1.O 966435042 m     Attawapiskat Ri… 146273    \n#\u003e # ℹ 395 more rows\n```\n\n#### Multiple Time Series\n\n``` r\n# Specified date, multiple time series\nmy_ts_ids \u003c- c(\"1125831042\",\"908195042\")\nmy_values \u003c- ki_timeseries_values(\n  hub = 'swmc',\n  ts_id = my_ts_ids,\n  start_date = \"2015-08-28\",\n  end_date = \"2018-09-13\"\n  )\n\nmy_values\n#\u003e # A tibble: 1,264 × 7\n#\u003e    Timestamp           Value ts_name       ts_id   Units station_name station_id\n#\u003e    \u003cdttm\u003e              \u003cdbl\u003e \u003cchr\u003e         \u003cchr\u003e   \u003cchr\u003e \u003cchr\u003e        \u003cchr\u003e     \n#\u003e  1 2015-09-06 05:00:00  0.19 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  2 2015-09-17 05:00:00  0.18 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  3 2015-09-26 05:00:00  0.19 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  4 2015-09-27 05:00:00  0.19 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  5 2015-09-28 05:00:00  0.19 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  6 2015-10-03 05:00:00  0.21 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  7 2015-10-08 05:00:00  0.22 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  8 2015-10-12 05:00:00  0.24 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e  9 2015-10-24 05:00:00  0.41 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e 10 2015-11-11 05:00:00  0.42 Q.DayBaseflow 112583… cumec Chippewa Cr… 140764    \n#\u003e # ℹ 1,254 more rows\n```\n\n## Using Other Hubs\n\nYou can use this package for a KiWIS hub not included in this list by\nfeeding the location of the API service to the `hub` argument.\n\nFor instance: If your URL looks like\n\n`http://kiwis.kisters.de/KiWIS/KiWIS?datasource=0\u0026service=kisters\u0026type=queryServices\u0026request=getrequestinfo`\n\nspecify the `hub` argument with\n\n`http://kiwis.kisters.de/KiWIS/KiWIS?`\n\nIf you’d like to have a hub added to the defaults, please [Submit an\nIssue](https://github.com/rywhale/kiwisR/issues)\n\n## Contributing\n\nSee\n[here](https://github.com/rywhale/kiwisR/blob/master/.github/CONTRIBUTING.md)\nif you’d like to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frywhale%2FkiwisR","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frywhale%2FkiwisR","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frywhale%2FkiwisR/lists"}