Skip to content

⚙️ - Rust library and command line interface for Dataverse

License

Notifications You must be signed in to change notification settings

gdcc/rust-dataverse

Repository files navigation

Dataverse Rust

Build Status

Dataverse Rust is a client library and command-line interface (CLI) for interacting with the Dataverse API. This project is in active development and not yet feature complete.

Features

Current capabilities include:

Collection Management

  • Create: Create a new collection within the Dataverse.
  • Delete: Remove an existing collection.
  • Publish: Publish a collection to make it publicly available.
  • Contents: Retrieve the contents of a collection.

General Information

  • Version: Retrieve the current version of the Dataverse instance.

Dataset Management

  • Get: Fetch details of a specific dataset.
  • Create: Create a new dataset within a collection.
  • Edit: Modify an existing dataset.
  • Delete: Delete an unpublished dataset.
  • Upload: Upload a file to a dataset.
  • Publish: Publish a dataset to make it publicly available.
  • Link: Link datasets to other collections.

File Management

  • Replace: Replace existing files in a dataset.

Installation

Command line

cargo install --git https://github.com/JR-1991/rust-dataverse.git

Cargo.toml

Please note, this crate is not yet published on crates.io. You can add it to your Cargo.toml file by pointing to the GitHub repository.

[dependencies]
dataverse = { git = "https://github.com/JR-1991/rust-dataverse" }

Usage

Command line

Before you can use the command line tool, you need to set the DVCLI_URL and DVCLI_TOKEN environment variables. You can do this by adding the following lines to your .bashrc or .bash_profile file:

export DVCLI_URL="https://your.dataverse.url"
export DVCLI_TOKEN="your_token_here"

The command line tool in organized in subcommands. To see a list of available subcommands, run:

dvcli --help

To see help for a specific subcommand, run:

dvcli <subcommand> --help

Example

In this examples we will demonstrate how to retrieve the version of the Dataverse instance.

dvcli info version

The output will be similar to:

Calling: http://localhost:8080/api/info/version
└──  🎉 Success! - Received the following response:

{
  "version": "6.2"
}

Examples

We have provided an example in the examples directory. These examples demonstrate how to use the client to perform various operations.

ToDo's

  • Implement remaining API endpoints
  • Write unit and integration tests
  • Asynchronous support using tokio
  • Documentation
  • Publish on crates.io
  • Continuous integration
  • Validate before upload using /api/dataverses/$ID/validateDatasetJson

About

⚙️ - Rust library and command line interface for Dataverse

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages