Skip to main content

A Jupyter Notebook extension which enables uploading to Zenodo from JupyterLab

Project description

Jupyterlab-Zenodo

A Zenodo extension for JupyterHub

Installation

This is part of a two-part extension: the lab extension (UI) and the server extension (which interfaces with Zenodo). In order to use this extension, both parts must be enabled. The following instructions should be run in your terminal.

To install the server extension:

pip install jupyterlab_zenodo

To enable the server extension:

jupyter serverextension enable --py jupyterlab_zenodo

To install the lab extension:

jupyter labextension install @chameleoncloud/jupyterlab_zenodo

Customization

You can add a series of (optional) custom features by adding lines to your jupyter_notebook_config.py file.

  1. Create a default Zenodo access token so that users don't need their own:
c.ZenodoConfig.access_token = '<your token>'
  1. Set up a post-upload redirect. By setting <your-url> below, users will be redirected to that site with an added 'doi' query parameter when they successfully create a new Zenodo upload.
c.ZenodoConfig.upload_redirect_url = '<your-url>'
  1. Set a default Zenodo community. The below will identify all depositions published with this extension with <your community>.
c.ZenodoConfig.community = '<your community>'
  1. Customize the internal storage database. Information about previous uploads to Zenodo on a user's server will be stored in <database-location> in a sqlite database called <database-name>. These default to /work/.zenodo/ and zenodo.db, respectively.
c.ZenodoConfig.database_location = '<database-location>'
c.ZenodoConfig.database_name = '<database_name>'

Development

To work with the extension without publishing directly to Zenodo, use Zenodo sandbox. Indicate that you're in a development environment and provide a default sandbox token in jupyter_notebook_config.py:

c.ZenodoConfig.dev = True
c.ZenodoConfig.access_token = '<your sandbox token>'

Testing

The server side of this extension comes with a set of integration tests. They can be used as follows:

  1. Create a Zenodo sandbox access token
  2. Assign the value TEST_API_TOKEN in jupyterlab_zenodo/test_init.py to your access token (as a string)
  3. Run make tests from the root in your terminal

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

jupyterlab_zenodo-0.1.4.tar.gz (15.3 kB view details)

Uploaded Source

File details

Details for the file jupyterlab_zenodo-0.1.4.tar.gz.

File metadata

  • Download URL: jupyterlab_zenodo-0.1.4.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for jupyterlab_zenodo-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b8f7d5a34ad41545fb3780f419ab5bf3f9058b4d096b21ff17aae56b394bba85
MD5 7d6987120033be89be0aa4adebf4fd2c
BLAKE2b-256 eeffc3b160f9baa1b477b61579cf0089960674f03ec98d98faea4345c955f04f

See more details on using hashes here.

Supported by

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