Giter VIP home page Giter VIP logo

nbreproduce's Introduction

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

nbreproduce's People

Contributors

dependabot[bot] avatar mriduls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jgarte

nbreproduce's Issues

Tell people they need python and pip

nbreproduce is targeted partly toward complete newbies. The instructions should therefore be explicit in saying that

  1. the commands need to be executed in an environment from which both python and pip work from the command line
  2. One way to accomplish both of those things is to install Anaconda
  3. If you are on a Windows machine and have installed Anaconda, you need to execute the commands from the "Anaconda prompt"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.