Package: ckanr 0.7.0.9000

Francisco Alves

ckanr: Client for the Comprehensive Knowledge Archive Network ('CKAN') API

Client for 'CKAN' API (<https://ckan.org/>). Includes interface to 'CKAN' 'APIs' for search, list, show for packages, organizations, and resources. In addition, provides an interface to the 'datastore' API.

Authors:Scott Chamberlain [aut], Imanuel Costigan [aut], Wush Wu [aut], Florian Mayer [aut], Sharla Gelfand [aut], Francisco Alves [aut, cre]

ckanr_0.7.0.9000.tar.gz
ckanr_0.7.0.9000.zip(r-4.5)ckanr_0.7.0.9000.zip(r-4.4)ckanr_0.7.0.9000.zip(r-4.3)
ckanr_0.7.0.9000.tgz(r-4.5-any)ckanr_0.7.0.9000.tgz(r-4.4-any)ckanr_0.7.0.9000.tgz(r-4.3-any)
ckanr_0.7.0.9000.tar.gz(r-4.5-noble)ckanr_0.7.0.9000.tar.gz(r-4.4-noble)
ckanr_0.7.0.9000.tgz(r-4.4-emscripten)ckanr_0.7.0.9000.tgz(r-4.3-emscripten)
ckanr.pdf |ckanr.html
ckanr/json (API)
NEWS

# Install 'ckanr' in R:
install.packages('ckanr', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ropensci/ckanr/issues32 issues

Pkgdown site:https://docs.ropensci.org

On CRAN:ckanr-0.7.0(2023-03-17)

Conda:

databaseopen-datackanapidatadatasetapi-wrapperckan-api

8.67 score 100 stars 4 packages 448 scripts 1.2k downloads 85 exports 32 dependencies

Last updated 2 years agofrom:f45afeaf9a (on master). Checks:8 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 25 2025
R-4.5-winOKFeb 25 2025
R-4.5-macOKFeb 25 2025
R-4.5-linuxOKFeb 25 2025
R-4.4-winOKFeb 25 2025
R-4.4-macOKFeb 25 2025
R-4.3-winOKFeb 25 2025
R-4.3-macOKFeb 25 2025

Exports:%>%as.ckan_groupas.ckan_organizationas.ckan_packageas.ckan_relatedas.ckan_resourceas.ckan_tagas.ckan_userchangesckan_fetchckan_infockan_versionckanr_settingsckanr_setupdashboard_activity_listdashboard_countds_createds_create_datasetds_searchds_search_sqlget_default_keyget_default_urlget_test_behaviourget_test_didget_test_gidget_test_keyget_test_oidget_test_ridget_test_urlgroup_creategroup_deletegroup_listgroup_patchgroup_showgroup_updateis.ckan_groupis.ckan_organizationis.ckan_packageis.ckan_relatedis.ckan_resourceis.ckan_tagis.ckan_userlicense_listorganization_createorganization_deleteorganization_listorganization_purgeorganization_showpackage_activity_listpackage_createpackage_deletepackage_listpackage_list_currentpackage_patchpackage_revision_listpackage_searchpackage_showpackage_updatepingrelated_createrelated_deleterelated_listrelated_showrelated_updateresource_createresource_deleteresource_patchresource_searchresource_showresource_updaterevision_listserverssrc_ckantag_createtag_listtag_searchtag_showuser_activity_listuser_createuser_deleteuser_followee_countuser_follower_countuser_follower_listuser_listuser_show

Dependencies:blobclicpp11crulcurlDBIdbplyrdplyrfansigenericsgluehttpcodejsonlitelifecyclemagrittrmimepillarpkgconfigpurrrR6Rcpprlangstringistringrtibbletidyrtidyselecttriebeardurltoolsutf8vctrswithr

Citation

To cite package ‘ckanr’ in publications use:

Chamberlain S, Costigan I, Wu W, Mayer F, Gelfand S, Alves F (2025). ckanr: Client for the Comprehensive Knowledge Archive Network ('CKAN') API. R package version 0.7.0.9000, https://github.com/ropensci/ckanr.

Corresponding BibTeX entry:

  @Manual{,
    title = {ckanr: Client for the Comprehensive Knowledge Archive
      Network ('CKAN') API},
    author = {Scott Chamberlain and Imanuel Costigan and Wush Wu and
      Florian Mayer and Sharla Gelfand and Francisco Alves},
    year = {2025},
    note = {R package version 0.7.0.9000},
    url = {https://github.com/ropensci/ckanr},
  }

Readme and manuals

ckanr

ckanr is an R client for the CKAN API.

Description

CKAN is an open source set of tools for hosting and providing data on the web. (CKAN users could include non-profits, museums, local city/county governments, etc.).

ckanr allows users to interact with those CKAN websites to create, modify, and manage datasets, as well as search and download pre-existing data, and then to proceed using in R for data analysis (stats/plotting/etc.). It is meant to be as general as possible, allowing you to work with any CKAN instance.

Get started: https://docs.ropensci.org/ckanr/

Installation

Stable CRAN version

install.packages("ckanr")

Development version

install.packages("remotes")
# remotes::install_github("ropensci/ckanr")
install.packages("ckanr", repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))
library('ckanr')

Note: the default base CKAN URL is set to https://data.ontario.ca/ Functions requiring write permissions in CKAN additionally require a privileged CKAN API key. You can change this using ckanr_setup(), or change the URL using the url parameter in each function call. To set one or both, run:

ckanr_setup() # restores default CKAN url to https://data.ontario.ca/
ckanr_setup(url = "https://data.ontario.ca/")
ckanr_setup(url = "https://data.ontario.ca/", key = "my-ckan-api-key")

ckanr package API

There are a suite of CKAN things (package, resource, etc.) that each have a set of functions in this package. The functions for each CKAN thing have an S3 class that is returned from most functions, and can be passed to most other functions (this also facilitates piping). The following is a list of the function groups for certain CKAN things, 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
  • Groups - group_*() - ckan_group
  • Users - user_*() - ckan_user
  • Related items - related_*() - ckan_related

The S3 class objects all look very similar; for example:

<CKAN Resource> 8abc92ad-7379-4fb8-bba0-549f38a26ddb
  Name: Data From Digital Portal
  Description:
  Creator/Modified: 2015-08-18T19:20:59.732601 / 2015-08-18T19:20:59.657943
  Size:
  Format: CSV

All classes state the type of object, have the ID to the right of the type, then have a varying set of key-value fields deemed important. This printed object is just a summary of 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

Contributors

(alphabetical)

  • Florian Mayer
  • Francisco Alves
  • Imanuel Costigan
  • Scott Chamberlain
  • Sharla Gelfand
  • Wush Wu

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for ckanr in R doing citation(package = 'ckanr')
  • Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Help Manual

Help pageTopics
R client for the CKAN APIckanr-package ckanr
ckan_group class helpersas.ckan_group is.ckan_group
ckan_organization class helpersas.ckan_organization is.ckan_organization
ckan_package class helpersas.ckan_package is.ckan_package
ckan_related class helpersas.ckan_related is.ckan_related
ckan_resource class helpersas.ckan_resource is.ckan_resource
ckan_tag class helpersas.ckan_tag is.ckan_tag
ckan_user class helpersas.ckan_user is.ckan_user
Get an activity stream of recently changed datasets on a site.changes
ckanr S3 classesckan_classes
Download a fileckan_fetch
Get information on a CKAN serverckan_info ckan_version
Get or set ckanr CKAN settingsckanr_settings get_default_key get_default_url get_test_behaviour get_test_did get_test_gid get_test_key get_test_oid get_test_rid get_test_url
Configure default CKAN settingsckanr_setup
Deprecated functions in 'ckanr'ckanr-deprecated
Authorized user's dashboard activity streamdashboard_activity_list
Number of new activities of an authorized userdashboard_count
Add a new table to a datastoreds_create
Datastore - create a new resource on an existing datasetds_create_dataset
Datastore - search or get a dataset from CKAN datastoreds_search
Datastore - search or get a dataset from CKAN datastoreds_search_sql
Create a groupgroup_create
Delete a groupgroup_delete
List groups.group_list
Update a group's metadatagroup_patch
Show a packagegroup_show
Update a groupgroup_update
Return the list of licenses available for datasets on the site.license_list
Create an organizationorganization_create
Delete an organizationorganization_delete
List organizationorganization_list
Purge an organizationorganization_purge
Show an organizationorganization_show
Return a list of the package's activitypackage_activity_list
Create a packagepackage_create
Delete a packagepackage_delete
List datasets.package_list
List current packages with resources.package_list_current
Update a package's metadatapackage_patch
Return a dataset (package's) revisions as a list of dictionaries.package_revision_list
Search for packages.package_search
Show a package.package_show
Update a packagepackage_update
Ping a CKAN server to test that it's up or down.ping
Create a related itemrelated_create
Delete a related item.related_delete
List related itemsrelated_list
Show a related itemrelated_show
Update a related itemrelated_update
Create a resourceresource_create
Delete a resource.resource_delete
Update a resource's metadataresource_patch
Search for resources.resource_search
Show a resource.resource_show
Update a resourceresource_update
Return a list of the IDs of the site's revisions.revision_list
CKAN server URLS and other infoservers
Connect to CKAN with dplyrdplyr-interface src_ckan
Create a tagtag_create
List tags.tag_list
Search tags.tag_search
Show a tag.tag_show
Return a list of a user's activitiesuser_activity_list
Create a user.user_create
Delete a user.user_delete
Return a a user's follower countuser_followee_count
Return a a user's follower countuser_follower_count
Return a a user's follower countuser_follower_list
Return a list of the site's user accounts.user_list
Show a user.user_show