Reproducible Dataset Workspace
Build a version-controlled Python project that fetches a public dataset, verifies it, converts it to Parquet and makes seeded splits that a fresh clone reproduces bit for bit.
Lessons this project uses
What you'll build
A small but real project skeleton you will reuse for every later phase. It pins its environment with a lockfile, downloads a public dataset you choose, checks the download against a known SHA-256, stores it as Parquet, and creates seeded train/validation/test splits. A one-command check proves that a fresh clone on another machine produces exactly the same splits, and a notebook explores the data by importing your code instead of copying it.
Requirements
- Environment. A
pyproject.tomlwithrequires-python = ">=3.11"and your dependencies, plus a committed lockfile (uv.lockorrequirements.lockfromuv pip compile). The README shows the exact commands to create the environment from the lockfile. - Git hygiene. A
.gitignorethat excludes at least.venv/,.env, raw and processed data files, and model checkpoint extensions (*.pt,*.pth,*.safetensors). No data files or virtual environment are committed. - Dataset choice. Pick a public tabular or text dataset between 1,000 and 1,000,000 rows and under 100 MB (a stable direct CSV URL or a Hugging Face dataset). Record its source URL, license and the expected SHA-256 of the downloaded file in
data/SOURCE.json. Do not use the IMDB example from the lesson. - Fetch script.
scripts/prepare_data.py(orpython -m yourpkg.prepare) downloads the file only if it is not already cached, verifies the SHA-256 and exits with a non-zero code and a clear message on mismatch. - Conversion and splits. The script writes the data as Parquet, then creates a 70/15/15 train/validation/test split with a fixed seed read from a config value (not a magic number buried in code).
- Data report. The script writes
results/data_report.jsoncontaining: row and column counts, column names, CSV size vs Parquet size in bytes, the row count of each split, and a content hash of each split (for example SHA-256 of the split's sorted row ids or of its CSV export). - Reproducibility check.
scripts/check_repro.sh(ormake check) runs the preparation twice into two separate output folders and compares the split hashes. It prints PASS and exits 0 when they match, otherwise prints FAIL and exits 1. - Notebook.
notebooks/explore.ipynbimports your loading function from your package, shows the first rows, summary statistics and at least one plot. It is committed after Kernel > Restart & Run All, so execution counts run 1, 2, 3 in order. - History. At least 6 meaningful commits, including one feature branch (for example
feature/parquet-export) merged back intomain.
Constraints
- Runs on an ordinary laptop (Linux, macOS or Windows with WSL2), CPU only. No GPU, no paid service, no API key.
- Use
uvor the built-invenv. Total download under 100 MB. - Standard libraries only for hashing (
hashlib); pandas or thedatasetslibrary for loading and Parquet (pyarrow).
Stretch goals
- Add a
Dockerfilethat builds the environment from the lockfile and runs the check inside a container. - Track the raw file with DVC instead of re-downloading it.
- Add a streaming mode that processes the dataset row by row and report peak memory.
How to submit
Public GitHub repo with this layout: README.md, pyproject.toml, the lockfile, .gitignore, data/SOURCE.json, scripts/prepare_data.py, scripts/check_repro.sh, notebooks/explore.ipynb, results/data_report.json. The README must list the setup and run commands, explain why you chose this dataset, why Parquet vs CSV sizes differ in your numbers, and one thing that broke during setup and how you fixed it. Paste the fresh-clone transcript and the outputs listed under evidence.
How it's reviewed
Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.
Submit
Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.
- Link to the public GitHub repo
- Terminal transcript of a fresh `git clone` into a new folder, environment creation from the lockfile, `which python` showing the project venv, and the full output of the reproducibility check with its exit code
- Contents of results/data_report.json from your run
- Output of `git log --oneline --graph --all` showing the merged feature branch
- Output of running the prepare script once with a deliberately wrong hash in data/SOURCE.json, showing the failure message and non-zero exit
Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.