labapi: a Python object model for the LabArchives electronic lab notebook
labapi is a Python library that bridges computational workflows and the LabArchives electronic lab notebook by translating its flat API into an intuitive object model, thereby automating the seamless reading and writing of experimental data to eliminate manual uploads.
Original paper dedicated to the public domain under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/). This is an AI-generated explanation of a preprint that has not been peer-reviewed. It is not medical advice. Do not make health decisions based on this content. Read full disclaimer
In the modern laboratory, the story of an experiment is no longer just a handwritten log in a leather-bound book. It is a digital record, a living archive where every observation, every calculation, and every result must be filed away with precision. For scientists at the National Institutes of Health and many other research institutions, this digital home is a system called LabArchives. It functions as an electronic notebook, a secure space where researchers document their work step-by-step, ensuring that the history of a discovery is preserved alongside the discovery itself. However, a gap has emerged between the way scientists work and the way these digital notebooks are built. While researchers increasingly rely on automated computer programs to process data—running complex calculations that generate results in seconds—they still have to manually copy and paste those results into the notebook through a web browser. It is a tedious, repetitive task that interrupts the flow of science, forcing a human to act as a bridge between a fast computer and a static webpage.
To solve this friction, a team of researchers has developed a new tool called labapi, a software library designed to let computer programs speak the same language as the electronic notebook. The core achievement of this work is the creation of a bridge that translates the flat, technical commands of the notebook's underlying system into a structure that feels natural to a human user. Instead of forcing a computer program to hunt for obscure internal codes to find a specific page, the new tool allows the program to navigate the notebook using the same familiar paths a person would use: moving from a notebook, into a folder, and down to a specific page. This tool does not just move data; it understands the hierarchy of the notebook, recognizing that a folder can contain other folders or pages, and that pages hold the actual entries of data. By building this structure, the authors have enabled researchers to create automated workflows that can write their results directly into the notebook and read them back later without any human intervention.
The developers designed this tool with a specific goal: to make the digital notebook feel as intuitive as the web interface that scientists already know. In the past, connecting a computer program to the notebook required writing custom code to translate a simple path, like "Project A/Results/Subject 1," into a complex series of internal requests. The new library handles this translation automatically. It includes helpers that can check if a folder exists and create it if it is missing, or find a specific page without needing to know its hidden internal ID. This approach follows a principle of "parse, don't validate," meaning the software accepts the path as the user types it and figures out the details, rather than forcing the user to conform to a rigid, pre-defined structure. This flexibility allows the software to create new entries, such as saving a complex data file as a JSON attachment, which then appears in the notebook with a formatted preview that humans can read easily.
The practical value of this tool is already being felt in real-world research. The authors have used it to build two specific applications that are now in use by other laboratories. One application, named muronto, automatically records the outputs of neuro-behavioral experiments, capturing data that would otherwise require manual entry. Another, called save-my-jupyter, takes snapshots of Jupyter notebooks—a common format for scientific coding—and deposits them directly into the electronic record. In a demonstration of the tool's capabilities, the authors showed how a workflow could take data from five different subjects, calculate a quality-control value for each, and write those results into the notebook. The system then read those saved values back, summarized them into a cohort report, and attached a visual figure to the same page. All of this happened automatically, with the computer navigating the notebook structure as if a human were clicking through the menus.
This work addresses a specific need within the scientific community, particularly for institutions that are required to use approved electronic notebooks for their research. While other systems for electronic lab notebooks have official software libraries to help with automation, LabArchives does not provide one publicly. Previous attempts to build a connection to the system were either incomplete, unmaintained, or required researchers to build the entire navigation system from scratch. The new library fills this gap, offering a general-purpose tool that combines path navigation, entry handling, and file transfer in a single package. It is designed to be used by computational researchers and software developers who work alongside experimental labs, providing them with a reliable way to keep their digital records up to date.
The tool is now available for anyone to use, with its source code and documentation published openly. It requires a modern version of the Python programming language to run and is released under a license that allows for broad use and modification. The developers have included examples and tests to help others get started, ensuring that the path from a raw data file to a permanent laboratory record is no longer a manual chore, but a seamless part of the scientific process. By removing the barrier between automated analysis and the electronic notebook, this tool allows scientists to focus more on the questions they are asking and less on the mechanics of filing their answers.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.