A simple tool to set up development environments for Jupyter notebooks. My motivation: basically, Jupyter notebooks are about the only program type for which it is still generally practiced to distribute the code through email or file sharing.
I was tired of running the same setup process over and over with notebooks that are usually emailed to me. I work in IDEs, usually Cursor and sometimes VSCode, and naturally also work with git.
I complained to claude-3.5-sonnet about that, and here we are.
Using notebookr you can typically cut that setup process down to a very short workflow:
- Receive and save python notebook (.ipynb) file into a working directory
- Open a terminal
notebookr SomeNotebookYouGot.ipynb
code some-notebook-you-got
Once your code editor opens, depening on your workflow, youʻll probably want to open the terminal (ctrl-`) and enter either
source .venv/bin/activate
... or:.venv\Scripts\activate
# windows
pip install notebookr
uv add notebookr
notebookr path/to/your/notebook.ipynb
notebookr --with_py path/to/your/notebook.ipynb # Also creates a python copy of the notebook
This will:
- Create a virtual environment
- Generate requirements.txt based on imports in your notebook
- Create a .gitignore
- Initialize a git repository
- Install required packages
0.1.1 added --with_py