hatching Kaggle attempts :]
A small Python 3.10+ template for Kaggle competitions. It keeps a real
installable placeholder helper package in src/challenge_xyz/ so shared
functions can be used from scripts, notebooks, and Kaggle package resources.
Forks should rename challenge_xyz to the competition package name once the
project stops being a template. The package is intentionally small: put shared
functions there, then import them from multiple Kaggle notebooks.
Create an environment and install the template:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade uv
uv sync --group dev --extra kaggle
On Kaggle, attach this repository or a built wheel as a resource, then install the helper package from that attached path:
pip install /kaggle/input/<resource-name>
Then import shared helpers from notebook cells:
from challenge_xyz import assert_same_csv_shape, read_csv_shape
For local smoke checks, install the package editable and run tests:
uv sync --group dev
uv run --group dev pytest -q
.
βββ src/challenge_xyz/ # reusable helper package shared by scripts and notebooks
βββ notebooks/ # percent-format notebook scripts with # %% cell markers
βββ resources/ # lightweight notes, links, and metadata
βββ tests/ # doctests and regression tests for shared helpers
βββ data/ # optional local competition files, ignored by git
βββ outputs/ # optional local generated files, ignored by git
uv run --group dev ruff check .
uv run --group dev pytest -q
uv build
uv run --group dev twine check dist/*
For a full local pre-commit pass:
uv run --group dev pre-commit run --all-files
When starting a new competition, update or add:
COMPETITION slug in docs, scripts, and CI examples if needed.