Giter Site home page Giter Site logo

jupyter_bootstrap's Introduction

Jupyter Bootstrap

Create a virtual environment in the current directory and create a Jupyter-lab kernel for that venv. Optionally setup Jupytext to automatically convert Jupyter Lab .ipynb files into flat python .py files.

Quick Start

Jupyter Bootstrap should reside in the root of your project. It will create a virtual environment in root of the project folder.

πŸ“ my_project ← project root
β”œβ”€Β README.md
β”œβ”€ requirements.txt
β”œβ”€Β πŸ“ project_files ← project files
β”‚Β Β β”œβ”€Β foo.py
│  └─ foo.ipynb
β”‚
β”œβ”€Β πŸ“ jupyter_bootstrap 
│  └─ project_init.sh
β””β”€Β πŸ“ my_project-VENV-d98f0 ← generated virtual environment

Add Jupyter Bootstrap as submodule

Adding jupyter_bootstrap as a git submodule make it easy to update to the latest version of the script with cd jupyter_bootstrap; git pull.

Add Jupyter Bootstrap as a git submodule:

cd /src/my_project_root/
git submodule add https://github.com/txoof/jupyter_bootstrap.git

Bootstrap a virtual environment

After installing the jupyter_bootstrap repo run the following command to build a virtual environment and add a jupyter kernel and add the Jupytext module to the system python environment.

From the project root:

./jupyter_bootstrap/project_init.sh -j -t

Launch Jupyter Lab and Select Kernel

To take full advantage of Jupyter Lab's file browser and ability to switch kernels, start Jupyter Lab in the directory above your project directory. Open your browser to https://localhost:8888, browse to your project and open a .ipynb. If you've insalled Jupytext, you can also open .py files.

πŸ“ src ← start jupyter lab here
β”œβ”€Β πŸ“ my_project
β”‚Β Β β”œβ”€Β πŸ“ assets
β”‚Β Β β”œβ”€Β πŸ“ jupyter_bootstrap
β”‚Β Β β””β”€Β πŸ“ my_project-VENV-d98f0
β”œβ”€Β πŸ“ other_project
β””β”€Β πŸ“ z_foobar

Launch Jupyter Lab

cd ~/src
jupyter lab

Select a kernel

From an open .ipynb, select the appropriate kernel for this project by clicking in the top right corner of the notebook:

Select Kernel

Usage

  Create a development environment for this project

  usage:
  $ ./project_init.sh [options]

  options:
  -c: create the virtual environment
  -j: create the virtual environment and add jupyter kernel
  -t: install Jupytext and add configuration file for converting .ipynb to .py
  -p: purge the virtual environment and clean up kernel specs
  --info: virtual environment information
  -h: This help screen

Requirements

  • Python 3
  • Jupyter Lab installed in your system Python environment
  • Git

jupyter_bootstrap's People

Contributors

txoof avatar

Watchers

 avatar

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.