Dataverse.downloads.file_download
— Functionfile_download(DOI::String,nam::String,pth=tempdir())
DOI="doi:10.7910/DVN/OYBLGK"
filename="polygons_MBON_seascapes.geojson"
Dataverse.file_download(DOI,filename)
Dataverse.downloads.file_download
— Functionfile_download(list::DataFrame,nam::String,pth::String)
lst=Dataverse.file_list("doi:10.7910/DVN/RNXA2A")
Dataverse.file_download(lst,lst.filename[2],tempdir())
Dataverse.downloads.untargz
— Methoduntargz(fil)
Decompress and extract data from a .tar.gz
file.
Dataverse.downloads.unzip
— Functionfunction unzip(file,exdir="")
Source : @sylvaticus, https://discourse.julialang.org/t/ how-to-extract-a-file-in-a-zip-archive-without-using-os-specific-tools/34585/5
Dataverse.pyDataverse.APIs
— MethodAPIs(;do_install=true,base_url = "https://dataverse.harvard.edu/")
(DataAccessApi,NativeApi)=pyDataverse.APIs()
Dataverse.pyDataverse.dataset_file_list
— Methoddataset_file_list(DOI::String="doi:10.7910/DVN/ODM2IQ")
Use NativeApi.get_dataset
to derive the list of files (name, etc) via files_to_DataFrame
.
dataset_file_list("doi:10.7910/DVN/ODM2IQ")
Dataverse.pyDataverse.dataset_file_list
— Methoddataset_file_list(nam::Symbol=:OCCA_clim)
Lookup DOI from list of demo data sets.
dataset_file_list(:OCCA_clim)
Dataverse.pyDataverse.dataverse_file_list
— Functiondataverse_file_list(nam::Symbol=:ECCOv4r2)
- Use
NativeApi.get_children
to get the tree of datasets - Loop through and return vector of
dataset_file_list
output
Dataverse.pyDataverse.demo
— Functiondemo(option::String)
- call
demo_download
ifoption=="download"
- call
demo_metadata
ifoption=="metadata"
Dataverse.pyDataverse.demo_download
— Methoddemo_download(;path=tempdir(),DOI = "doi:10.7910/DVN/KBHLOD")
Replicate the worflow example from
pyDataverse.demo_download()
Dataverse.pyDataverse.demo_metadata
— Methoddemo_metadata()
pyDataverse.demo_metadata()
Dataverse.restDataverse.dataverse_scan
— Functiondataverse_scan(nam::Symbol=:ECCOv4r2)
Use HTTP, JSON, and DataFrames to list contents in a dataverse.
Returns header (Dict), dataverses (DataFrame), and datasets (DataFrame).
(header,dataverses,datasets)=Dataverse.dataverse_scan()
Dataverse.file_list(datasets.persistentUrl[1])
Dataverse.restDataverse.file_list
— Functionfile_list(DOI::String="doi:10.7910/DVN/ODM2IQ")
Use HTTP, JSON, and DataFrames to list files in a dataset.
Return a DataFrame with filename, filesize, and id.
file_list("doi:10.7910/DVN/ODM2IQ")
Dataverse.restDataverse.file_list
— Methodfile_list(nam::Symbol=:OCCA_clim)
Lookup DOI from list of demo data sets (:OCCAclim or :ECCOclim).
Dataverse.restDataverse.files_to_DataFrame
— Methodfiles_to_DataFrame(files)
Convert output from dataset.json()["data"]["latestVersion"]["files"]
to a DataFrame
.