- Notifications
You must be signed in to change notification settings - Fork38
ropensci/ckanr
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ckanr is an R client package for theCKAN API,enabling R users to interact with CKAN data portals for reading, writing, and managing datasets.The package wraps the entire CKAN REST API with R functions organized by resource type(packages, resources, organizations, groups, users, tags).
CKAN is an open-source DMS (data management system) for powering data hubs and data portals.CKAN makes it easy to publish, share and use data. It powers hundreds of data portals worldwide.
ckanr allows users to interact with those CKAN websites to create, modify, and managedatasets, as well as search and download pre-existing data, and then to proceed using inR for data analysis (stats/plotting/etc.). It is meant to be as general as possible,allowing you to work with any CKAN instance.
ckanr works for and is tested against
- theCKAN v2.11 API,
- theCKAN v2.10 API, and
- theCKAN v2.9 API.
ckanr may work with older and newer CKAN versions.
Get started:https://docs.ropensci.org/ckanr/
Stable CRAN version
install.packages("ckanr")Development version
# From sourceinstall.packages("remotes")remotes::install_github("ropensci/ckanr")# Binary via the rOpenSci universeoptions(repos= c(ropensci="https://ropensci.r-universe.dev",CRAN="https://cloud.r-project.org" ))install.packages("ruODK")
library("ckanr")Note: the default base CKAN URL is set tohttps://demo.ckan.org/Functions requiring write permissions in CKAN additionally require a privilegedCKAN API key.You can change this usingckanr_setup(), or change the URL using theurlparameter in each function call.To set one or both, run:
ckanr_setup()# restores default CKAN url to https://demo.ckan.org/ckanr_setup(url="https://demo.ckan.org/")ckanr_setup(url="https://demo.ckan.org/",key="my-ckan-api-key")
There are a suite of CKAN things (package, resource, etc.) that each have a set offunctions in this package. The functions for each CKAN thing have an S3 class that isreturned from most functions, and can be passed to most other functions (this alsofacilitates piping). The following is a list of the function groups for certain CKANthings, with the prefix for the functions that work with that thing, and the name of the S3 class:
- Packages (aka packages) -
package_*()-ckan_package - Resources -
resource_*()-ckan_resource - Related -
related_*()-ckan_related - Users -
user_*()-ckan_user - Groups -
group_*()-ckan_group - Tags -
tag_*()-ckan_tag - Organizations -
organization_*()-ckan_organization
The S3 class objects all look very similar; for example:
<CKANResource>8abc92ad-7379-4fb8-bba0-549f38a26ddbName:DataFromDigitalPortalDescription:Creator/Modified:2015-08-18T19:20:59.732601/2015-08-18T19:20:59.657943Size:Format:CSV
All classes state the type of object, have the ID to the right of the type, then have avarying set of key-value fields deemed important. This printed object is just a summaryof an R list, so you can index to specific values (e.g.,result$description).If you feel there are important fields left out of these printed summaries, let us know.
note: Many examples are given in brief for readme brevity
(alphabetical)
- Florian Mayer
- Francisco Alves
- Hanna Böhner
- Imanuel Costigan
- Scott Chamberlain (original creator)
- Sharla Gelfand
- Wush Wu
- Pleasereport any issues or bugs.
- License: MIT
- Get citation information for
ckanrin R viacitation(package = 'ckanr') - Please note that this package is released with aContributor Code of Conduct.By contributing to this project, you agree to abide by its terms.
- If you want to contribute to the package development, please see thecontributing guide.
About
R client for the CKAN API
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.