Skip to main content

This package provides functions to write an automated labnotebook using git.

Project description

Labnotebook 📔🖥

This project aims to help bioinformaticians in creating the so called "Laboratory notebook" automatically, thanks to git workflow manager.

IMPORTANT: this tool is based on git and its application, in particular, through git history it will create an html notebook divided by date and commit.

Features

  • Automatically create a laboratory notebook
  • Customizable CSS file
  • Direct link to analysis files (expecially for user who creates .html reports. e.g. markdown or jupyter notebook html)
  • Export to html

Installation

To install the package, run:
pip install pylabnotebook

This will install the pylabnotebook package; you can then run labnotebook function from within the terminal (detailed explanation below).

Notebook structure

The structure of the notebook is very simple. You can see an example here.

On top, you have the notebook name, the author and the notebook creation date. Then, for each day, you have a list of all the commits done, organized as follow:

  • Commit message (first line)
  • Commit body
  • Commit author
  • Commit sha
  • Analysis file (which can be hidden if you don't have this type of features)
  • List of changed files

Create a notebook

To create a notebook, go to the folder in which is present the .git folder and type notebook create -n <name_of_the_notebook>. If you want to have spaces in your name, just wrap it into quotes.

A .labnotebook folder is created, containing config.json file, a basic .css file and three file containing head, body and footer html file.

IMPORTANT: never change the name of the created folder and its files!

Update a notebook

When you want to update the notebook, go to the folder in which is present the .git folder, type notebook update. It will check for new commits and upate the files in .labnotebook folder.
If the git history have changed and the last commit present in the labnotebook is no longer in gith history, it will raise an error; you can skip this by forcing the update (-f/--force).

IMPORTANT: After each notebook update a commit is made with labnotebook as author. This will ensure that these commits are not considered during the update, as only commits without labnotebook as author are used.

Link to analysis files

When updating the notebook, it automatically create a list of analysis files for each commit with direct links to them. By default, it takes all the .html files changed/added in that commit.
If you want to add different extensions, you can update the .labnotebook config.json file by adding/removing extensions in the ANALYSIS_EXT variable. Each extension should be separated by a comma, as it is considered an array (eg. "ANALYSIS_EXT": ['.html', '.txt'])Just type the extension, not wildcards or other special characters.
Moreover, by creating a ".labignore" file, you can exclude some files/folders to be recognized as analysis files (as for a standard .gitignore file it will use wildcards).

Export html file

When you want to export the full html file containing the notebook, go to the folder in which is present the .git folder, type labnotebook export -o <name_of_the_output_file>.

Issue reporting and suggestions

If you find any issue or you want to suggest some edit, please feel free to open an issue or a pull request.

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

pylabnotebook-0.1.3.tar.gz (9.7 kB view hashes)

Uploaded Source

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