Skip to main content

Citable Loader

Project description

Citable

Citable is a Python package for downloading datasets from Zenodo by using their DOIs.

from citable import Citable
dataset = Citable('DOI')
r = dataset.download()

Installing Citable and supported versions

Citable is available on PyPI:

$ python -m pip install citable

Citable supports Python 3.6+.

Supported Features

Citable is a handy tool for downloading and using data from Zenodo.

  • Downloading data from Zenodo
  • Unzipping the downloaded data if necessary
  • Returning suitable data as a pandas DataFrame or displaying Markdown descriptions if you like to

Usage

First the Citable class must be imported into Python:

from citable import Citable

After doing so you must initiate a Citable object. You pass a DOI from Zenodo formatted as a string into the initiating method and give the returned object a name:

dataset = Citable('DOI')

The Citable class has only one function. This is the download() function.

r = dataset.download(showMarkdown = True, pandas = True)

You can pass along two arguments with this function, both of which are boolean: showMarkdown and pandas. By default both are set to True, meaning that any markdown description contained in the downloaded data is shown via IPython and the package assumes you are using pandas DataFrames.

Input

  • showMarkdown: if you don't want the markdown displayed, insert the argument showMarkdown = False into the download function
  • pandas: if you don't want to return a list containing pandas DataFrames but rather want to do your own thing and just want to know where the downloaded data was stored, insert the argument pandas = False into the download() function.

Output

The output of the download function depends whether the input variable pandas is True or False:

  • pandas == True: The download function returns a list of pandas DataFrames and strings ready for you to use
  • pandas == False: The download function returns a dictionary of the file names of the downloaded data and where they have been stored, so that you can copy & paste the path of the data you want to work with into your favourite data handler

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

citable-0.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

citable-0.1-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page