Skip to content

achillesrasquinha/boilpy

Repository files navigation

boilpy

The Best Python Package Template in the Universe

boilpy is a carefully crafted Python Package Template that is designed to ease your development, testing and deployment workflow. It heavily emphasizes on convention over configuration so you can focus on getting straight down to building and distributing your very next python package.

Contents

Features

  • Configurable package creation with "sensible defaults".
  • "Open Source First" package creation with pre-configured CI-CD.
  • Industry Standard tooling capabilities.
  • Python 2.7+, Python 3.4+ and PyPy aware boilerplate.

Quick Start

pip install -q cookiecutter && cookiecutter gh:achillesrasquinha/boilpy

For an exhaustive installation guide, you can visit the Documentation here.

Usage

boilpy provides you a production-ready template out of the box! For most tasks, boilpy consists of a well-defined Makefile which can be used to run make commands within your project directory.

In order to get started, we recommend you to create a .env file within your project directory in order to configure some of the environment variables declared within the Makefile. You can override the environment variables defined here. To override some of the environment variables, you could also declare them at run-time as follows:

foo@bar:~/foobar$ FOO=BAR BAR=BAZ make [command]

1. Configuration

First, create an isolated virtual environment for your package using virtualenv:

foo@bar:~/foobar$ make env
→ [20:37:10] Creating a Virtual Environment .venv with Python - /usr/bin/python

2. Installation

Simply install your package as follows:

foo@bar:~/foobar$ make install
→ [20:38:23] Cleaning Python Cache
→ [20:38:23] Cleaning Successful
→ [20:38:23] Building Requirements
→ [20:38:23] Installing Requirements
→ [20:38:23] Installing foobar (development)
→ [20:38:23] Installation Successful

3. Prototyping

To check if your package works, launch the shell:

foo@bar:~/foobar$ make shell

...and then simply import your package as follows:

In [1]: import foobar as fb
In [2]: fb.__name__
Out[2]: 'foobar'

To check if the command-line interface works, activate the virtual environment:

foo@bar:~/foobar$ source .venv/bin/activate

...and then simply type the command:

foo@bar:~/foobar$ foobar
Usage: foobar [OPTIONS] COMMAND [ARGS]...

  A foobar package

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  help     Show this message and exit.
  version  Show version and exit.

License

This repository has been released under the MIT License.