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. Read the documentation.
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 typelabnotebook 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, typelabnotebook 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 git 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, typelabnotebook 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pylabnotebook-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3b7cf109e14c1e82b18e45b65757b690070dc788707aea9dc721b2ffa7d0ccf |
|
MD5 | 6ff9c4830465bf885bdd92487c2af853 |
|
BLAKE2b-256 | 16910c6917aa3ae537d9e158f4356c3562cff8be06a0f861e8958d6aec3dc38c |