27. How to Use Git with Jupyter Notebooks for Data Projects
27.2 Project Folder Layout
Why. Mixing raw CSV, cleaned CSV, charts, and notebooks in one pile breaks teammates and your future self.
What. A simple layout that matches Chapter 22 folder hygiene:
blinkit_mh_lab/
data/raw/ # original extracts (often gitignored if huge)
data/clean/ # reproducible cleans
notebooks/ # *.ipynb
outputs/ # csv / png for managers
.gitignore
README.md
How.
Create the skeleton
- Make the folders above.
- Put your main notebook under
notebooks/. - Write outputs only under
outputs/. - Keep a short
README.md(how to run, fictional data note). git initinsideblinkit_mh_lab/(once).
Worked example A — mkdir (shell).
mkdir -p blinkit_mh_lab/data/raw blinkit_mh_lab/data/clean \
blinkit_mh_lab/notebooks blinkit_mh_lab/outputs
cd blinkit_mh_lab
git init
Worked example B — README stub.
# Blinkit Maharashtra lab (fictional)
Sample orders for learning pandas. Not real company data.
Run notebooks in order: 01_clean.ipynb → 02_eda.ipynb
Worked example C — Paths inside notebook.
from pathlib import Path
ROOT = Path("..").resolve() # if notebook is in notebooks/
RAW = ROOT / "data" / "raw"
OUT = ROOT / "outputs"
OUT.mkdir(exist_ok=True)
Ravindra Bagale's Tip
raw / clean / outputs — teen boxes. Notebook logic Git madhe; multi-GB raw usually baher.