Reproduce Jupyter Notebooks inside Docker Containers.
Project description
nbreproduce
Reproduce Jupyter Notebooks and projects inside Docker Containers (based on Jupyter Docker-Stacks images) using the nbreproduce
CLI.
- Free software: BSD license
- Documentation: https://nbreproduce.readthedocs.io. (not up yet, use
$ nbreproduce -h
to get a quick desciption of various flags)
Installation:
$ pip install nbreproduce
Features:
-
Reproduce a Jupyter Notebook (URL or local file) inside a Docker container for consistent builds across all the devices capable of running docker and Python.
-
To test the
hello_world.ipynb
example in this repo.
$ nbreproduce --url https://github.com/econ-ark/nbreproduce/blob/master/tests/hello_world.ipynb
-
The
nbreproduce
will create a new Jupyter notebook ending withfilename-reproduce.ipynb
in the same directory which is a copy of the original notebook but executed inside the docker container environment. -
nbreproduce
requires a special metadata tag (docker_image
) inside in the Jupyter notebook to find the link to docker image on DockerHub. On the first run ofnbreproduce
with a normal Jupyter notebook it will prompt you to add a docker image tag, these docker images are built on top of Jupyter Docker-Stacks. Thehello_world.ipynb
example can run with thescipy-notebook
standard image. Using the--docker
flag you can point it towards the right docker image. (Currently only DockerHub imgags are supported)
$ nbreproduce --docker jupyter/scipy-notebook:latest hello_world.ipynb
- For a Jupyter notebook which already has the metadata tag (
docker_image
), we can directly execute the notebook, kind of like papermill but inside a standardised docker environemnt :)
$ nbreproduce hello_world.ipynb
- Reproduce entire folders and projects inside a Docker environment (it works by mounting the current directory to the docker container and running a bash file which has all the required steps to reproduce all the content like figures, builiding latex documents, slides, etc).
$ nbreproduce --docker econark/econ-ark-notebook do_all.sh
Executing do_all.sh using the econark/econ-ark-notebook environment inside a docker container.
Executing do_all.sh in the current directory /Users/ms/dev/REMARK/REMARKs/CGMPortfolio
....
....
....
- The project is in pre alpha developement mode, so things will break. Don't use this in production. The documentation website doesn't exist yet, use
nbreproduce -h
to get a quick desciption of various flags. Feel free to open up any issue for suggestions or submit a PR to fix bugs/implement new features.
Credits
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
audreyr/cookiecutter-pypackage
History
0.2.0 (2020-08-12)
- Add --live interactive mode.
- Add ability to execute bash scripts.
- Docker SDK.
0.1.0 (2020-06-10)
- Pre-alpha release to get the ball rolling.
- First release on PyPI.
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
Built Distribution
File details
Details for the file nbreproduce-0.2.0.tar.gz
.
File metadata
- Download URL: nbreproduce-0.2.0.tar.gz
- Upload date:
- Size: 97.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7c76854e6d13e2ab00420916b21d3ec7a43c61712782816382fd7cfd3ae89c8 |
|
MD5 | a2af85f33d59e78a35cb1f844d51eed7 |
|
BLAKE2b-256 | cad387689192e05a661d583fad81a25354dd0645245d99ca13d7bcd4c25b640a |
File details
Details for the file nbreproduce-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: nbreproduce-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e419937a7ba2bcd608f17b495dcc447026fb8e894773d96d7a7cf9077f9b4f2c |
|
MD5 | f5e6bcefa61016e1800ad286128cf0f7 |
|
BLAKE2b-256 | a55a4996a1308b8b41dde4831f717c3f365b4c525113d30deafdee9602edfb39 |