Jupyter Notebooks

Flexible Intake 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 Flexible Intake-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.

Flexible Intake 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.

A python library to make using the API easier and more convenient is available: library and its documentation. This library can be used in Functions, Jupyter Notebooks and in your own scripts.

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 Flexible Intake 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 Flexible Intake 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 Flexible Intake libraries:

If your Function is going to be called from a Flexible Intake Function, you will receive some parameters from Flexible Intake 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 in the documentation.

And then, you would usually have your payload. In this example:

And finally, we must let Flexible Intake know that our function has finished, with the result status:

The full code sample:

Last updated

Was this helpful?