Setting up and working with elabFTW

In order to create a script that uploads directly to elabFTW, you will need to have the file eLabFTW_config_api2_semilab.py present within the same directory as the script using elabFTW functionality:

This library provides a convenient set of functions to push measured data immediately into an electronic notebook.
This wrapper library relies on the elabapi_python package that is preinstalled on the measurement computers. You will need to customize this library. The neccessary adaptions will be shown in a dedicated section below.

Your measurement script should contain at least the following lines of code:


Mock Python script containing the basic lines needed for a script working with elabFTW.

Basic setup

Log in at elabFTW

Go to the TU Graz elabFTW webpage and log in with your TU Graz student credentials.


Create and add your own token id="token"

(1) Log into the elabFTW page, on the top right corner click the account icon and select USER PANEL in the dropdown menu.
Then go to API KEYS (1), under Create new key enter a name (2), e.g., your lab_group or similar, select Read/Write permissions (3) and click Generate An API Key (4). You will now be shown a long string, copy this somewhere safe.



ATTENTION
The key will be shown to you only once: Do not leave the page until you have stored the key in an appropriate place!
Refrain from uploading any file containing your key to elabFTW !
Should you loose this key, you can delete it from the list and generate a new one.

(2) Within the earlier mentioned eLabFTW_config_api2_semilab.py, you will find a section CONFIG with the line API_KEY = '---ENTER-YOUR-APIKEY-HERE----' . Replace the string ---ENTER-YOUR-APIKEY-HERE---- with your newly created token.
Replace in the next line USER_LAST_NAME = '---ENTER-YOUR-USER-LASTNAME-HERE----', with your last name, that is just the real last name associated to your TUGRAZonline user account. Enter this last name literally, including any special characters, e.g., "Großbäcker". Upon being called in your working script, this function uses your token as authorization to control the data transmitted to elabFTW.

Give team members access

Once the experiment is set up correctly, go to the elabFTW page and find it under the Experiments tab. Click Edit (the pen symbol), then click the Visibility. Therein, you should set both options to the smallest possible group that you have access to. For example, it could be all members of your lab group. Each user can be asked for individually by providing her/his/their user name.



In order to find your data in the experiment tab, you can use the tag that is created (#semilab) and your own tags.



Sample script

This is an example for ELabFTW integration into a diode measurement (diode_characteristic.py):