A simple template for research project repos. You can also use data science and reproducible science cookie cutters.
This template contains the following folders and files. See README.md in each folder for more details and guidelines.
srcfor project source code (installed as editable package).testsfor unit tests.datafor raw & derived datasets.libsfor third-party or vendored packages.modelsfor trained models.notebooksfor (timestamped) experiment notebooks.paperfor manuscripts.resultsfor results (figures, tables, etc.)workflowfor workflow files and scripts..gitignorefor temporary and binary files to be ignored by git (LaTeX, Python, Jupyter, data files, etc.)
This template uses uv for Python environment management. Run the setup script for initial configuration:
./setup.sh # Install dependencies and configure environment.python-version— specifies the required Python release.venv/— virtual environment directory (created by uv)pyproject.toml— project metadata and dependency declarationsuv.lock— reproducible dependency snapshot (commit to version control).envrc— direnv configuration for automatic venv activation
uv add PACKAGE # Add dependency
uv sync # Install from lockfile
uv run script.py # Run script in virtual environmentSee Python environment setup for details.
ruff is included as a dev dependency. VS Code settings (.vscode/settings.json) enable format on save.
Install hooks to auto-run ruff and tests before commits:
uv add --dev pre-commit
uv run pre-commit installUse the following instructions to initialize.
Commands:
uv sync— install dependenciesuv run pytest— run testsuv run ruff check .— lintuv run ruff format .— formatmake all— run Snakemake pipeline
Conventions:
- Write clean code accompanied by well-designed tests.
- Use type hints for all function signatures.
- Import project code as
from project_name import .... - Put reusable code in
src/, not in notebooks or workflow scripts. - Timestamp experiment folders:
YYYYMMDD_description.