Closed jsta closed 2 years ago
Good idea @jsta
I would be happy to look more into this. It does seem like it would be easy to interact with the API and get datasets info in JSON formats. I think I could get something started, although getting the package up to the standards of ropensci
is beyond my dev skills at the moment.
Edit: After a little digging around, it is indeed very easy to look for datasets and access metadata. We could therefore have a opencan
or ropencan
package to look for datasets and maybe set up the download of some specific file formats.
library(jsonlite)
library(tidyverse)
## Seach for DGO related datasets
url <- "https://open.canada.ca/data/api/3/action/package_search?q=dfo"
dfo_search <- fromJSON(url)
dfo_search$result$results$id
## Search for the pelagic bords dataset, id found on opencanada website
pel_id <- "4a2929ce-d6b1-49b0-b520-63be0859c552"
url_pel <- paste0(
"https://open.canada.ca/data/en/api/3/action/package_show?id=",
pel_id)
pel <- map(url_pel, fromJSON)
pel_df <- tibble(pel[[1]]$result$resources)
I will explore and see if I can get something started here: https://github.com/VLucet/rgovcan
@jsta @sckott I have been searching frantically for the past few hours to make sure no one has done this yet (I have taken a few steps toward a first version of the package and I would not want to spend more efforts reinventing the wheel). Could you confirm that as far as you know, this has not been done?
If yes, Is it possible to add a label "being done" to this? @karthik
I have asked a similar question here: https://discuss.ropensci.org/t/new-package-in-development-ropencan/1704 as I am unsure if this repo is still used for discussing new package ideas
@VLucet added the label, nice work getting this going, will comment more in the forum thread
FYI, rgovcan is now on CRAN https://CRAN.R-project.org/package=rgovcan
Thank you!
Note that future ideas should go to our wishlist forum category.
What will the package do?
I envision that an R client to access this data would have similar scope to
rnoaa
.Relevant links (For e.g. API docs, related software)
http://open.canada.ca/data/en/dataset?organization=dfo-mpo
Do you need help with development or are just suggesting the idea?
Just suggesting for now. I see that there may already be efforts to address this but unsure of the scope. See https://github.com/poissonconsulting/rtide/issues/5