Project

zenodo

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the Zenodo API. https://zenodo.org/dev. ZENODO builds and operates a simple and innovative service that enables researchers, scientists, EU projects and institutions to share and showcase multidisciplinary research results (data and publications) that are not part of the existing institutional or subject-based repositories of the research communities.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
~> 3.0
~> 2.9
~> 1.18

Runtime

 Project Readme

NOT ACTIVELY MAINTAINED

Zenodo

A Ruby wrapper for the Zenodo API.

Installation

Add this line to your application's Gemfile:

gem 'zenodo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install zenodo

Due to the use of keyword arguments this gem requires Ruby 2.0 and above.

Configuration

This gem uses VCR for testing. https://github.com/vcr/vcr

To run gem tests complete the following:

  1. Obtain a Zenodo API token from their site. https://zenodo.org.
  2. Create file gem_secret.yml in the gems config folder.
  3. Add the following to your gem_secret.yml file. zenodo_api_key: '<YOUR API TOKEN>'
  4. Run rspec as normal.

VCR will create fixtures in the spec/fixtures/vcr_cassettes folder.

Usage

Set the client API key.

Zenodo.api_key = <your API key>

Get depositions.

depositions = Zenodo.client.get_depositions

Get a deposition.

deposition = Zenodo.client.get_deposition(id: 1)

Create a deposition.

# Build JSON serialized attributes.
# The gem won't do this for you. You need to build a serializer that meets your needs."
deposition_attributes = {
  'metadata' => {
    'title' => 'My first upload',
    'upload_type' => 'poster',
    'description' => 'This is my first upload',
    'creators' =>[{'name' => 'Doe, John','affiliation' => 'ZENODO'}]
  }
}

# Create the deposition.
deposition = Zenodo.client.create_deposition(deposition: deposition_attributes)

Update a deposition.

# Build JSON serialized attributes.
# The gem won't do this for you. You need to build a serializer that meets your needs."
# deposition_attributes = <same as create>

# Update the deposition.
deposition = Zenodo.client.update_deposition(id: 1, deposition: deposition_attributes)

Delete a deposition.

Zenodo.client.delete_deposition(id: 1)

Contributing

  1. Fork it ( https://github.com/sprotocols/zenodo/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request