A CarbonPlan cookiecutter template for a starting a Python project.
In a virtual environment install cookiecutter:
pip install cookiecutter
After installing cookiecutter run:
cookiecutter https://github.com/carbonplan/carbonplan-cookiecutter-python
This should run a CLI that walks you through project templating.
Todo: add instructions to:
- push your new project to github:
- enable github settings (for CI, pre-commit gh action etc)
- instructions for docs: carbonplan docs vs readme vs rtd or?
- create an environment (mamba, uv, pixi, venv etc..)
- install your your project
- run pre-commit
- run mypy
TODO: how do we use cruft to keep all projects up to date?
This template uses:
- Github actions for CI
pre-commit
for code quality and linting #todo-mypy
for typing- pytest for testing
- conda/mamba environment.yaml file if your project has difficult dependencies (GDAL, xESMF etc.)
- pyproject.toml for project information
We can modify these and add more defaults such as:
- docs (.md)
- pypi and pypi-test
- pixi or uv for env
- or others (open an issue)
All the code in this repository is MIT-licensed, but we request that you please provide attribution if reusing any of our digital content (graphics, logo, articles, etc.).
CarbonPlan is a nonprofit organization that uses data and science for climate action. We aim to improve the transparency and scientific integrity of climate solutions with open data and tools. Find out more at carbonplan.org or get in touch by opening an issue or sending us an email.