You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
@Edouard-Legoupil thanks for the suggestion and I would be happy to make a PR to add this functionality. As suggested on option is to wrap the Python API, see below:
library(reticulate)
library(tidyverse)
### Example from the github page https://github.com/OCHA-DAP/hdx-python-api#getting-startedhdx<- import("hdx")
conf<-hdx$hdx_configuration$Configurationconf$create(hdx_site="demo", hdx_read_only=FALSE) ### demo### You need to follow for your CKAN API Key https://github.com/OCHA-DAP/hdx-python-api#obtaining-your-api-keyconfig<-conf$read()
key<-config$get_api_key()
### Function to create dataset and resourcedataset<-hdx$data$dataset$Datasetresource<-hdx$data$resource$Resource### Create a datasetmeta<-list(name="iris_flower",
title="Iris flower data set",
notes="Typical test case for classification algorithm",
methodology="Other",
methodology_other="Collected by Ronald Fisher",
dataset_source="Gondwana",
subnational=1,
license_id="hdx_other",
private=FALSE,
url="http://dickoa.gitlab.io")
### We create the dataset from the dictdf<- dataset(r_to_py(meta))
### Need to add a maintainer, set org and other metadatadf$set_maintainer(key)
df$set_organization('5a63012e-6c41-420c-8c33-e84b277fdc90') ## Innagodf$set_dataset_date(as.character(Sys.Date()))
df$set_expected_update_frequency("Every two weeks")
df$add_country_location("MLI")
df$add_tags(r_to_py(list("Rstats", "test")))
### Create a resource and add it to the datasettmp_file<- tempfile(fileext=".csv")
write_csv(iris, path=tmp_file)
res<-list(name="iris.csv", format="csv", description="iris data csv")
res<- resource(r_to_py(res))
res$set_file_to_upload(tmp_file)
### add to the datasetdf$add_update_resource(r_to_py(res))
### Pushdf$create_in_hdx()
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If indicators is not classified as sensitive, the value should be pushed to an on line repository (CKAN based) such as http://data.humdata.org/
This probably requires to:
The text was updated successfully, but these errors were encountered: