gitmiller

A tool to run a Jupyter Notebook from a (partial) Github repository.


Install
pip install gitmiller==0.1.5

Documentation

GitMiller

This description can be found on GitHub here

GitMiller is a tool for running Jupyter Notebooks from a (partial) Github repository. It downloads the repository in your temp folder, runs a designated notebook within it, and removes all downloaded files afterwards.

Installation

$ pip install gitmiller

After installation you can use the gitmiller command-line tool to run your github notebooks.

Usage

The command-line interface takes the following input parameters:

parameter description
-u, --username Username to gain access to GitHub repository
-p, --password Password Github repository
-t, --token Or use a Github token
-r, --repository URL of GitHub repository (can be a subfolder)
-n, --notebook filename of notebook you wish to execute, this file must exist in the root folder of the (partially) downloaded folder structure.
-o, --output local path where GitMiller will put the executed version of your notebook
-c, --config local path of YAML file in which you can add all mentioned paramaters

GitMiller uses Papermill to run your remote notebook. Besides executing, Papermill also enables you to parameterize notebooks. If you would like to override certain variables in your notebook, add the variables and values in the config YAML file under the papermill key. See example below.

This repository contains a folder example in which a notebook test.ipynb exists. If you would like to run this notebook with GitMiller, use either:

$ gitmiller -u <GITHUB USERNAME> -p <GITHUB PASSWORD>, -r https://github.com/UtrechtUniversity/GitMiller/tree/master/example, -n test.ipynb, -o <LOCAL OUTPUT-PATH>

or create the following YAML file:

repository: https://github.com/UtrechtUniversity/GitMiller/tree/master/example
username: <GITHUB USERNAME>
password: <GITHUB PASSWORD>
notebook: test.ipynb
output: <LOCAL OUTPUT-PATH>

papermill:
  a: 10
  b: 60

and run with:

$ gitmiller -c <PATH TO YAML-FILE>

Note for Windows users

The script isn't able to remove the temp-folder after the Notebook has been processed on Windows machines. I have tried a lot of things, but couldn't find a solution. Manually removing also turned out to be impossible when using a terminal. I give up. At the end a message is printed in which the path of the folder is mentioned so you can remove it yourself.