Appendix A1: Using Jupyter Notebook
This appendix assumes you’ve completed Part 0 — Python installed, .venv created and active, packages installed via pip install -r requirements.txt. Everything below is specific to running this book’s code inside Jupyter Notebook instead of from a plain terminal.
Install the notebook
requirements.txt already installed Jupyter for you in Part 0, so you can likely skip straight to “Start the notebook” below. If you skipped that step, or only want Jupyter on its own:
pip install notebookExpected output: a Successfully installed ... line mentioning notebook.
Start the notebook
With your virtual environment active (you should see (.venv) in your terminal prompt) and from inside the ddr-rag-book project folder:
jupyter notebookWhat this does: starts a local notebook server and opens a new browser tab showing the contents of your project folder.
If nothing opens automatically, the terminal will print a URL starting with http://localhost:8888/... — copy and paste that into your browser.
Open a chapter notebook
Every chapter of Part I has an interactive companion notebook. In the browser tab Jupyter opened, click into the notebooks/ folder, then open chapter_01_explore.ipynb (or whichever chapter you’re on).
Run a cell
A notebook is made of cells — small blocks of code you run one at a time. Click into a cell, then press Shift+Enter to run it and move to the next one. The output (printed text, or an error) appears directly below the cell.
Expected output: for Chapter 1’s notebook, running the extraction cell prints the real report text described in that chapter.
Stop the notebook server
When you’re done, go back to the terminal window where you ran jupyter notebook and press Ctrl+C, then confirm if asked. Closing the browser tab alone does not stop the server — the terminal is where it’s actually running.