Skip to content

Creating Python Packages

Charles Turner edited this page Mar 18, 2025 · 4 revisions

Scaffolding a Python Package

ACCESS-NRI maintain a cookiecutter template which can be used to scaffold a python package. This enables you to quickly scaffold much of the boilerplate required to create a python package, for example creating the package and tests directory structure, and setting up linters, type checkers, etc.

If you don't already have cookiecutter installer (which cookiecutter to check):

$ python -m pip install cookiecutter

You can then scaffold the package with

$ cookiecutter https://github.com/ACCESS-NRI/cookiecutter-pypackage-access

This will generate a series of prompts which enable you to customise your package - for example, setting contact details, configuring type checking strictness, whether to create placeholder entrypoints.

When you want to publish your package, you will need to configure publishing - see the Continuous integration and Deployment page.

If the cookiecutter template does not include (or allow configuration for) something you think it should, please raise an issue.

Clone this wiki locally