Skip to main content

nbreproduce

PyPI version

Reproduce Jupyter Notebooks and projects inside Docker Containers (based on Jupyter Docker-Stacks images) using the nbreproduce CLI.

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 with filename-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 of nbreproduce 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. The hello_world.ipynb example can run with the scipy-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.

Cookiecutter

audreyr/cookiecutter-pypackage

History

0.4.1 (2020-10-18)

  • auto fix EOL for bash scripts in windows.

0.4.0 (2020-09-22)

  • .dockerimage file let's you add the name of the docker image, it should exist either in the root directory or the reproduce/ directory.

0.3.0 (2020-09-16)

  • Add --inplace suppport for individual notebooks.

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.

Metadata

Release files for nbreproduce 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbreproduce 0.4.1
File Size Uploaded
nbreproduce-0.4.1.tar.gz 98.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nbreproduce 0.4.1
File Interpreter ABI Platform
nbreproduce-0.4.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 106.9 kB

Release files / nbreproduce-0.4.1.tar.gz

Download URL nbreproduce-0.4.1.tar.gz
Size 98.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f7a7cd866a0c9f06a18053edd98ab9325a20ac1daa94577b248600b0ad388860
BLAKE2b-256 checksum
How to use checksums
0222b784344893dbaede64dc74374d49a47e7e6c81deeb83f0bdcf40d39237df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.7.4

Release files / nbreproduce-0.4.1-py2.py3-none-any.whl

Download URL nbreproduce-0.4.1-py2.py3-none-any.whl
Size 8.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
22094f69ff19ef0ab4bcf0dc370823a27148caacd3849f10265600e9ec4133e0
BLAKE2b-256 checksum
How to use checksums
bba89edc043d971aca3d648d1bdef7e8940b4d72fe78b0f0ef1f7f21277378ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page