Skip to main content

A Jupyter Notebook extension which enables uploading to Zenodo from JupyterLab

Project description

jupyterlab-zenodo

A Zenodo extension for JupyterLab.

Installation

This is part of a two-part extension: the JupyterLab extension (UI) and the Notebook 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.

ZenodoConfig.access_token

You can create a default Zenodo access token so that users don't need their own. This token will be used for any user of the Jupyter Notebook, so it should probably be created under a dedicated account for your deployment.

c.ZenodoConfig.access_token = '<your token>'

ZenodoConfig.upload_redirect_url

If you want to perform additional processing on the upload after it is published to Zenodo, you can specify a post-create redirect location. By setting <your-url> below, users will be redirected to that site (with an added "doi" query parameter for the created Zenodo artifact) when the upload is successfully published.

c.ZenodoConfig.upload_redirect_url = '<your-url>'

ZenodoConfig.update_redirect_url

Similar to upload_redirect_url, this allows you to redirect users to a custom URL after a new version of an existing artifact is successfully published. A "doi" and "previous_doi" query parameter will be added to the URL for you.

c.ZenodoConfig.update_redirect_url = '<your-url>'

ZenodoConfig.community

Set a default Zenodo community. All depositions published with this extension will automatically be associated with the community <your community>.

c.ZenodoConfig.community = '<your community>'

ZenodoConfig.database_location

Information about previous uploads to Zenodo on a user's server will be stored in <database-location> in a SQLite database. This defaults to /work/.zenodo/.

c.ZenodoConfig.database_location = '<database-location>'

ZenodoConfig.database_name

Set a custom SQLite3 database name. This defaults to zenodo.db.

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. Run ZENODO_ACCESS_TOKEN=<token> make tests from the root in your terminal, using the sandbox access token as <token>.

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.2.0.tar.gz (15.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: jupyterlab_zenodo-0.2.0.tar.gz
  • Upload date:
  • Size: 15.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 74e9e22933fb38094787affa96271c2b37fedb70a9df6c3b59c9dbdd6a2b4923
MD5 3803a8742ed1d1c5379257cd34b07473
BLAKE2b-256 1dc6e21e31e180c63e6d314946278d84f8e89c9b5b35fb62c678fe4f17a05a3f

See more details on using hashes here.

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