{"id":22713577,"url":"https://github.com/program--/hsclientr","last_synced_at":"2025-10-16T23:27:45.419Z","repository":{"id":107794135,"uuid":"341659373","full_name":"program--/HSClientR","owner":"program--","description":"R :package: for accessing the HydroShare API","archived":false,"fork":false,"pushed_at":"2021-04-08T10:00:58.000Z","size":1293,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T00:27:46.613Z","etag":null,"topics":["api-wrapper","cuashi","hydrology","hydroshare","r","rstats","water-resources"],"latest_commit_sha":null,"homepage":"https://hsclientr.justinsingh.me","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/program--.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-02-23T19:02:04.000Z","updated_at":"2024-10-18T12:54:38.000Z","dependencies_parsed_at":"2023-09-24T18:09:45.593Z","dependency_job_id":null,"html_url":"https://github.com/program--/HSClientR","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"d054bb7a6f839e7f5388a830b44c88a0e94a06ca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2FHSClientR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2FHSClientR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2FHSClientR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2FHSClientR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/program--","download_url":"https://codeload.github.com/program--/HSClientR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246254097,"owners_count":20747948,"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":["api-wrapper","cuashi","hydrology","hydroshare","r","rstats","water-resources"],"created_at":"2024-12-10T14:09:35.739Z","updated_at":"2025-10-16T23:27:45.311Z","avatar_url":"https://github.com/program--.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n# HSClientR - A [HydroShare](https://www.hydroshare.org) API Client for R \u003ca href='https://github.com/program--/HSClientR'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\u003c!-- badges: start --\u003e\n**Usage**|**Development**\n:-----:|:-----:\n[![CRAN status](https://www.r-pkg.org/badges/version/HSClientR)](https://CRAN.R-project.org/package=HSClientR)|[![R-CMD-check](https://github.com/program--/HSClientR/workflows/R-CMD-check/badge.svg)](https://github.com/program--/HSClientR/actions)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)|[![Travis build status](https://travis-ci.com/program--/HSClientR.svg?branch=master)](https://travis-ci.com/program--/HSClientR)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)|[![test-coverage](https://github.com/program--/HSClientR/workflows/test-coverage/badge.svg)](https://github.com/program--/HSClientR/actions)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)|[![Codecov test coverage](https://codecov.io/gh/program--/HSClientR/branch/master/graph/badge.svg)](https://codecov.io/gh/program--/HSClientR)\n\u003c!-- badges: end --\u003e\n\nHSClientR is an API wrapper for\n[HydroShare](https://www.hydroshare.org). Using HSClientR, you can\naccess resources from HydroShare directly in your R environment, either\nby the package functions or the in-development\n[`R6 Class`](https://r6.r-lib.org/reference/R6Class.html).\n\n## Installation\n\nYou can install the developmental version of HSClientR with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"program--/HSClientR\")\n```\n\n## Documentation\n\n- [Package Website](https://hsclientr.justinsingh.me)\n- [HydroShare API](https://www.hydroshare.org/hsapi/)\n\n## Example Using Package Functions\n\nThis is a basic example which shows you how to access a resource. We’ll\naccess the resource [Hydrologic Terrain Analysis Using Web Based\nTools](https://www.hydroshare.org/resource/e1d4f2aff7d84f79b901595f6ea48368/),\nas well as some additional functionality.\n\n### Authenticating with HydroShare\n\n``` r\n# To set auth headers\nhs_auth(set_headers = TRUE)\n```\n\nThis function will begin an [OAuth 2.0](https://oauth.net/2/) dance between your R session and the\nHydroShare API. This is only needed if you are utilizing `hs_user()`/`hs_userDetails()` or any of the\n`DELETE`, `POST`, and `PUT` functions. Most of the `GET` functions are publicly accessible.\n\n``` r\n# Search for resources\nhs_resource(\n    text = \"Hydrologic Terrain Analysis Using Web Based Tools\",\n    author = \"David Tarboton\"\n)\n\n# Alternatively, if you want to use specific functions,\n# you can call hs_search() with the same parameters\n\n#\u003e $.next\n#\u003e [1] NA\n#\u003e \n#\u003e $.prev\n#\u003e [1] NA\n#\u003e \n#\u003e $results\n#\u003e # A tibble: 5 x 10\n#\u003e   id     title    author abstract   contributor subject  availability content_type\n#\u003e   \u003cchr\u003e  \u003cchr\u003e    \u003cchr\u003e  \u003cchr\u003e      \u003cchr\u003e       \u003cchr\u003e    \u003cchr\u003e        \u003cchr\u003e       \n#\u003e 1 c1be8… Clearin… Tarbo… \"Can your… \"\"          #gisDay… public       Composite, …\n#\u003e 2 1302d… Clearin… Tarbo… \"Can your… \"\"          AGU2015  public       Composite, …\n#\u003e 3 e1d4f… Hydrolo… Tarbo… \"Digital … \"\"          TauDEM,… public       Presentatio…\n#\u003e 4 66fd9… Materia… Tarbo… \"Material… \"\"          Worksho… public       Presentatio…\n#\u003e 5 d752e… The Mod… Tarbo… \"Model My… \"\"          present… public       Presentatio…\n#\u003e # … with 2 more variables: metadata \u003clist\u003e, geodata \u003clist\u003e\n```\n\nAnother way of finding resources is via the Discover API.\nThis is equivalent to accessing the \"Discover\" page directly\non the HydroShare website. It returns the first 40 results.\n\n\u003e It is preferred to use `hs_resource()` or any of the other `hs_*` functions,\n\u003e as they have better support/flexibility in contrast to `hs_discover()`.\n\n``` r\nhs_discover()\n\n#\u003e # A tibble: 40 x 6\n#\u003e    title          link          author       abstract          short_id   metadata\n#\u003e    \u003cchr\u003e          \u003cchr\u003e         \u003cchr\u003e        \u003cchr\u003e             \u003cchr\u003e      \u003clist\u003e  \n#\u003e  1 SUMMA Simulat… https://hydr… Choi, Young… \"These are examp… 03dc01d36… \u003ctibble…\n#\u003e  2 SUMMA Simulat… https://hydr… Choi, Young… \"These are examp… ac54c8046… \u003ctibble…\n#\u003e  3 NLDAS Forcing… https://hydr… Choi, Young… \"This resource w… a28685d2d… \u003ctibble…\n#\u003e  4 SHAW model in… https://hydr… Marshall, A… \"This dataset su… 5a355d673… \u003ctibble…\n#\u003e  5 Application o… https://hydr… Pedrazas, M… \"Fluvio-deltaic … cf3c26339… \u003ctibble…\n#\u003e  6 ModelMyWaters… https://hydr… Ensign, Sco… \"A watershed mul… a10bfc16d… \u003ctibble…\n#\u003e  7 Wasatch Envir… https://hydr… University … \"This dataset co… 5057577e8… \u003ctibble…\n#\u003e  8 Wasatch Envir… https://hydr… University … \"This dataset co… 252980b3b… \u003ctibble…\n#\u003e  9 Wasatch Envir… https://hydr… University … \"This dataset co… 6445418c7… \u003ctibble…\n#\u003e 10 Wasatch Envir… https://hydr… University … \"This dataset co… 74dc57ed7… \u003ctibble…\n#\u003e # … with 30 more rows\n```\n\nYou can also call hs_resource() with no parameters to do basic pagination searches.\n\n\u003e This is usually preferred over hs_discover().\n\n``` r\nhs_resource()\n\n#\u003e $.next\n#\u003e [1] \"https://www.hydroshare.org/hsapi/resource/search?page=2\"\n#\u003e \n#\u003e $.prev\n#\u003e [1] NA\n#\u003e \n#\u003e $results\n#\u003e # A tibble: 100 x 10\n#\u003e    id     title  author  abstract  contributor subject  availability content_type \n#\u003e    \u003cchr\u003e  \u003cchr\u003e  \u003cchr\u003e   \u003cchr\u003e     \u003cchr\u003e       \u003cchr\u003e    \u003cchr\u003e        \u003cchr\u003e        \n#\u003e  1 73aae… 00_Ze… Arscot… \"Stroud … \"\"          mmw, mo… public       Geographic F…\n#\u003e  2 73ad4… 00_Ze… Gisond… \"Second … \"\"          osi, mo… public       Geographic F…\n#\u003e  3 ea93a… 00_Ze… Gisond… \"Part of… \"\"          osi, mo… public       Geographic F…\n#\u003e  4 a2a5c… 01_Pe… Gish, … \"Aggrega… \"\"          cbf, mm… public       Geographic F…\n#\u003e  5 5002f… 01_Ze… Gisond… \"Part of… \"\"          osi, mo… public       Geographic F…\n#\u003e  6 1048d… 02_Ma… Gish, … \"Aggrega… \"\"          cbf, mm… public       Geographic F…\n#\u003e  7 b4b3c… 02_Ze… Gisond… \"Second … \"\"          osi, mo… public       Geographic F…\n#\u003e  8 fb70e… 02_Ze… Gisond… \"Part of… \"\"          osi, mo… public       Geographic F…\n#\u003e  9 74704… 03_Cl… Gish, … \"Aggrega… \"\"          cbf, mm… public       Geographic F…\n#\u003e 10 737cf… 03_Mo… Gisond… \"Second … \"\"          osi, mo… public       Geographic F…\n#\u003e # … with 90 more rows, and 2 more variables: metadata \u003clist\u003e, geodata \u003clist\u003e\n```\n\nYou can also find resources by HydroShare alphanumeric IDs:\n\n``` r\nhs_resource(id = \"e1d4f2aff7d84f79b901595f6ea48368\")\n\n#\u003e # A tibble: 1 x 19\n#\u003e   resource_title  resource_type  resource_id abstract authors creator doi   public\n#\u003e   \u003cchr\u003e           \u003cchr\u003e          \u003cchr\u003e       \u003cchr\u003e    \u003cchr\u003e   \u003cchr\u003e   \u003clgl\u003e \u003clgl\u003e \n#\u003e 1 Hydrologic Ter… CompositeReso… e1d4f2aff7… \"Digita… David … David … NA    TRUE  \n#\u003e # … with 11 more variables: discoverable \u003clgl\u003e, shareable \u003clgl\u003e, immutable \u003clgl\u003e,\n#\u003e #   published \u003clgl\u003e, date_created \u003cchr\u003e, date_last_updated \u003cchr\u003e, bag_url \u003cchr\u003e,\n#\u003e #   science_metadata_url \u003cchr\u003e, resource_map_url \u003cchr\u003e, resource_url \u003cchr\u003e,\n#\u003e #   content_types \u003clist\u003e\n```\n\nFor more details on using `hs_resource()`, refer to the\n[documentation site](https://hsclientr.justinsingh.me/reference/hs_resource.html).\n\n## Example Using R6 HydroShare Client Class\n\n\u003e Note: functionality for queries and discover traversal still need to\n\u003e be implemented. The example below may change as the object matures.\n\n``` r\n# Create new HSClient object\nhs_client \u003c- HSClient$new()\n\n#\u003e R6-based client still in-development.\n#\u003e Full functionality may not exist.\n#\u003e \n#\u003e HSClientR - R6 Client\n#\u003e =======================================\n#\u003e Thanks for using HSClientR! ♥\n#\u003e You can start a query with $query()\n#\u003e Make sure to authenticate with $authenticate()\n#\u003e =======================================\n\nhs_client$print()\n\n#\u003e It looks like you haven't authenticated yet...\n#\u003e Please call $authenticate() on this object to get\n#\u003e OAuth2 authentication set up with HydroShare! :)\n\n# Begin authentication (hs_auth)\nhs_client$authenticate()\n\n# OAuth2 Dance will begin and a web browser\n# will open to HydroShare's login/authorization\n# page. Once you login, an access token will be\n# sent back to a local httpuv web server for\n# your R session.\n\n# Search for a resource (hs_resource)\nhs_client$query(text = \"NHDPlus VAA\")\n\n#\u003e # A tibble: 2 x 18\n#\u003e   text     author  abstract    contributor subject   availability created modified\n#\u003e   \u003cchr\u003e    \u003cchr\u003e   \u003cchr\u003e       \u003cchr\u003e       \u003cchr\u003e     \u003cchr\u003e        \u003cchr\u003e   \u003cchr\u003e   \n#\u003e 1 \" \\n ba… Rea, A… \"The NHDPl… \"\"          NHDPlus,… public       2019-0… 2019-08…\n#\u003e 2 \" \\n 60… Johnso… \"These fil… \"\"          roughnes… public       2020-1… 2021-02…\n#\u003e # … with 10 more variables: coverage_type \u003cchr\u003e, east \u003cdbl\u003e, northlimit \u003cdbl\u003e,\n#\u003e #   eastlimit \u003cdbl\u003e, southlimit \u003cdbl\u003e, westlimit \u003cdbl\u003e, start_date \u003clgl\u003e,\n#\u003e #   end_date \u003clgl\u003e, resource_type \u003cchr\u003e, content_type \u003cchr\u003e\n\n# $query uses hs_search() to perform the query,\n# and while a tibble is outputted, the object returns\n# itself invisibly. Once the query is performed, we can\n# print our object to see our last query and its results:\n\nhs_client$print()\n\n#\u003e Authenticated as:\n#\u003e Justin Singh-Mohudpur\n#\u003e User: jsinghm\n#\u003e ID:   8409\n#\u003e Org:  University of California, Santa Barbara\n#\u003e =======================================\n#\u003e Last Query ($query): text = \"NHDPlus VAA\"\n#\u003e Query Results:\n#\u003e  \n#\u003e  6092c8a62fac45be97a09bfd0b0bf726  \n#\u003e  \n#\u003e  NHDPlus Value Added Attributes - no geometries  \n#\u003e  These files contain a curated set ...\n```\n\n## Meta\n\n* Please [report any issues or bugs](https://github.com/program--/HSClientR/issues).\n* License: MIT\n* Please note that this package is released with a [Contributor Code of Conduct](https://hsclientr.justinsingh.me/code_of_conduct). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Fhsclientr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogram--%2Fhsclientr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Fhsclientr/lists"}