An open API service indexing awesome lists of open source software.

https://github.com/ucl-arc/python-tooling

Python package template for new research software projects
https://github.com/ucl-arc/python-tooling

cookiecutter hacktoberfest python python-template python-templates python3 research-software research-software-engineering ucl

Last synced: 4 months ago
JSON representation

Python package template for new research software projects

Awesome Lists containing this project

README

          


UCL ARC Python tooling logo

UCL ARC Python Recommendations


This repository collects the [UCL ARC] recommendations for a research software
project in Python. It contains a template for new Python packages and a
[website] documenting our recommendations. We've turned on
[discussions](https://github.com/UCL-ARC/python-tooling/discussions) for this
repo, and we welcome questions there or in the `#helpme` channel on the
[UCL research programming hub Slack](https://www.ucl.ac.uk/advanced-research-computing/community/ucl-research-programming-hub).

πŸͺ Our template is a [cookiecutter] template which automatically creates new
Python packages with our recommended tooling set up and ready to go.

> [!NOTE]
> If you're making a package within a community that has an existing
> package template (e.g., [`scikit-hep`](https://github.com/scikit-hep/cookie)),
> we recommend using their template instead of this one.

## Tutorial

Some quick instructions for using our template are below.
We also have a [tutorial](./tutorial.md) that has been presented in a couple of workshops aimed at researchers at UCL.

## Using our template

If you have [uv] installed, you can use our template with the following one-liner:

```sh
uvx cookiecutter gh:ucl-arc/python-tooling --checkout latest
```

Alternatively you can [install cookiecutter] (following the recommended instructions).
Do this if you don't use [uv], or if you're likely to want to use cookiecutter again.

Then you'll need to run cookiecutter with our template:

```sh
cookiecutter gh:ucl-arc/python-tooling --checkout latest
```

When [cookiecutter] runs, it will ask you a series of questions to configure your project.
Type the answer or hit return without typing anything to use the default option (shown in parenthesis).
At the end, it will print some more follow-up information in the terminal for things like creating a remote repository and making a website for your package.

It will have created a directory for your project.
You can see the structure with the `tree` command.
In our example we've called our project `example-research-software-project`:

```sh
ls -ltr | tail -n1 # Shows the last directory that was created
tree example-research-software-project
```

To work on your project, initialise a `git` repository and _install_ your new package editable mode.
You probably want to do this in a [virtual environment](./docs/pages/virtual.md).
The comments show how to do this in [uv] with `uv venv`:

```sh
cd example-research-software-project
git init
# uv venv
# source .venv/bin/activate
uv pip install -e ".[dev]"
```

[website]: https://github-pages.arc.ucl.ac.uk/python-tooling
[UCL ARC]: https://ucl.ac.uk/arc
[cookiecutter]: https://cookiecutter.readthedocs.io/en/stable
[install cookiecutter]: https://cookiecutter.readthedocs.io/en/stable/README.html#installation
[uv]: https://docs.astral.sh/uv

## Contributors



Patrick J. Roddy
Patrick J. Roddy

πŸ€” πŸ› πŸ’» πŸ–‹ πŸ“– πŸ“‹ πŸ“† πŸ’¬ πŸ‘€ πŸ“’ ⚠️
Sam Cunliffe
Sam Cunliffe

πŸ€” πŸ› πŸ’» πŸ–‹ πŸ“– πŸ“‹ πŸ“† πŸ’¬ πŸ‘€ πŸ“’ ⚠️
David Stansby
David Stansby

πŸ€” πŸ› πŸ’» πŸ–‹ πŸ“– πŸ“‹ πŸ“† πŸ‘€ ⚠️
Matt Graham
Matt Graham

πŸ› πŸ’» πŸ–‹ πŸ“– 🎨 πŸ“‹ πŸ‘€ πŸ“’ ⚠️
sfmig
sfmig

πŸ› πŸ’» πŸ–‹ πŸ‘€ ⚠️
Paul Smith
Paul Smith

πŸ› πŸ’» πŸ–‹ πŸ“– πŸ’¬ πŸ‘€ ⚠️
Renovate Bot
Renovate Bot

🚧


ruaridhg
ruaridhg

πŸ› πŸ’» πŸ–‹ πŸ‘€
Miguel Xochicale, PhD
Miguel Xochicale, PhD

πŸ› πŸ’» πŸ–‹ 🎨 πŸ“– πŸ‘€
yidilozdemir
yidilozdemir

πŸ“– ⚠️
Mosè Giordano
Mosè Giordano

πŸ› πŸ“– πŸ‘€
Tom Young
Tom Young

πŸ› πŸ–‹ πŸ‘€
Alessandro Felder
Alessandro Felder

πŸ› πŸ–‹
Adam Tyson
Adam Tyson

πŸ–‹


Will Graham
Will Graham

πŸ–‹ πŸ‘€
nikk-nikaznan
nikk-nikaznan

πŸ–‹
Katie Buntic
Katie Buntic

πŸ–‹
Robert Vickerstaff
Robert Vickerstaff

πŸ“–
David PΓ©rez-SuΓ‘rez
David PΓ©rez-SuΓ‘rez

πŸ’» πŸ’¬
llapira
llapira

πŸ›
pre-commit.ci
pre-commit.ci

🚧


Saransh Chopra
Saransh Chopra

πŸ“– πŸ–‹ 🚧 πŸ‘€
Andrew Mitchell
Andrew Mitchell

πŸ›
Kimberly Meechan
Kimberly Meechan

πŸ› ️️️️♿️ πŸ‘€