Seth-Rothschild / cookiecutter-python-scientific

A cookiecutter template for (my preferred) style of python project structure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PR

I presented this project at the Boston Python User Group on 23 Oct 2018. My slides for that talk are here.

Introduction

This is a cookiecutter template that reflects my current understanding of best practices for making rapid python projects for scientific computing and research.

Out of the box, this template will install a python 3.6+ package with numpy, attrs, and either docopt or click installed for command line parsing.

Requirements

This cookiecutter template expects you to have, and wish to use:

  • python 3.6 or later
  • a system capable of running make
  • pipenv for virtual environment management
  • the cookiecutter templating system.

Use

To create a new project, run:

# creates a new directory in the current directory
cookiecutter gh:gvoysey/cookiecutter-python-scientific -o .

and follow the prompts. The package_name option is required, and will be the name of your new python package (and created directory).

At this point, you can now cd to your new project, and run pipenv shell to enter an activated virtual environment. An entry point into your new python project has already been created – using the value of package_name you created in the wizard, run package_name --version and note that while your new package doesn’t do anything, it knows what version it is!

Test runners with coverage have been preconfigured. To use them, run

make test

A linter suite has also been preconfigured. To use them, run

make lint

Features

This package supports:

  • pytest / hypothesis
  • org-file readmes by default
  • test coverage with coverage.py
  • pipenv integration

About

A cookiecutter template for (my preferred) style of python project structure


Languages

Language:Python 90.0%Language:Makefile 10.0%