Giter VIP home page Giter VIP logo

dataverse-client-python's Introduction

Dataverse API Client

PLEASE NOTE: This library is maintained by the Dataverse community, not IQSS.

This is a library for writing Python applications that make use of Dataverse APIs v4.0. The intent is to publish the python client on https://pypi.python.org.

Installation

$ pip install -e git+https://github.com/IQSS/dataverse-client-python.git#egg=dataverse

Requires Python >= 2.6.

Usage

To use the python client, you will need a dataverse account and an API token.

from dataverse import Connection

host = 'demo.dataverse.org'                  # All clients >4.0 are supported
token = '4d0634d3-74d5-4770-8088-1971847ac75e'  # Generated at /account/apitoken

connection = Connection(host, token)
# For non-https connections (e.g. local dev environment), try:
#   connection = Connection(host, token, use_https=False)

Dataverse Objects can be retrieved from their respective containers

dataverse = connection.get_dataverse('ALIAS')
dataset = dataverse.get_dataset_by_doi('DOI:10.5072/FK2/ABC123')
files = dataset.get_files('latest')

Testing

Configuration

Create a file at dataverse/settings/local.py. The file should contain the following information:

TEST_HOST = 'demo.dataverse.org'

Do not commit this file.

Running Tests

To run tests:

$ py.test

Or, to run a specific test:

$ py.test dataverse/test/test_dataverse.py::TestClassName::test_method_name

To check for style:

$ flake8 .

dataverse-client-python's People

Contributors

astrofrog avatar codersquid avatar icereval avatar pdurbin avatar raprasad avatar rliebz avatar samchrisinger avatar sloria avatar tombaxter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.