Jupyter Notebooks
LIBSAFE Go is integrated with Jupyter Notebooks. Jupyter Notebooks are documents that contain an organized list of input/output cells which can contain code (Python usually, but other languages can be used), text (using Markdown), mathematics, plots and rich media, that can be executed step by step or in full, in a very easy to use environment, in a LIBSAFE Go-integrated computational environment.
The source code used to create, read and analyze scientific and research data is usually created by the researchers as Jupyter Notebooks, and must also be preserved, along with the datasets. It is usually the best existing Provenance and Structure metadata for the dataset.
LIBSAFE Go allows users to keep the Jupyter Notebooks in which they have the code that reads and "understands" their data as part of the dataset they are creating.
Before using the Jupyter notebooks feature, make sure that your user has an active API key and S3 credentials already generated. If not, a 403 Forbidden error will be shown while trying to access a notebook.
Create a new digital notebook
When in the Explore Content tab of a Data container, right-click over an empty space in the files area. Select New and then Dynamic Notebook, to create a new notebook.

Upload an existing Jupyter Notebook
You can upload any existing Jupyter Notebook like any other file, using a file transfer protocol or simply dragging and dropping your file to the LIBSAFE Go Data Container.
Open an existing Jupyter Notebook
To open a Jupyter Notebook, double click the notebook icon you would like to open.
How to use them
You can use your Jupyter Notebooks in the same way you would use them in any other platform but, if you plan to work with the data you have in a LIBSAFE Go container, we have created a Python library that simplifies many actions and makes your programming easier.
For example, let's say you would like to create a function that hashes your files with a new algorithm you would like to use.
First, you should initialize your function, loading the LIBNOVA LIBSAFE Go libraries:
If your Function is going to be called from a LIBSAFE Go Function, you will receive some parameters from LIBSAFE Go every time your Function is called, but if you plan to use it inside a Jupyter Notebook, you should initialize it on your own:
Every function executes in relation to an (Execution) Job, that is really useful for logging the execution progress. You should initialize it with:
And you can log to it using:
The JobMessage.JobMessageType defines the type of message. You can see a list of the available types here.
And then, you would usually have your payload. In this example:
And finally, we must let LIBSAFE Go know that our function has finished, with the result status:
The full code sample:
Last updated
Was this helpful?

