Python Package Generator¶
Scaffold a modern ready-to-develop Python Package (see Quickstart)
Automatically generate over 24 files, to setup Test Suite, build scripts & CI Pipeline
Python Package Template (source code at src/cookiecutter_python/) implemented as a Cookiecutter
Extensively Tested on various systems, factoring the below:
System’s platform: “Linux”, “MacOS” & “Windows”
System’s Python: 3.6, 3.7, 3.8, 3.9 & 3.10
See the Test Workflow on the CI server.
Auto Generated Sample Package Biskotaki¶
Check the Biskotaki Python Package Project, for a taste of the project structure and capabilities this Template can generate!
It it entirely generated using this Python Package Template:
Generated Python Package Features¶
Test Suite, using pytest, located in tests dir
Parallel Execution of Unit Tests, on multiple cpu’s
Documentation Pages, hosted on readthedocs server, located in docs dir
Automation, using tox, driven by single tox.ini file
CI Pipeline, running on Github Actions, defined in .github/
Job Matrix, spanning different platform’s and python version’s
Platforms: ubuntu-latest, macos-latest
Python Interpreters: 3.6, 3.7, 3.8, 3.9, 3.10
Parallel Job execution, generated from the matrix, that runs the Test Suite
pip install --user cookiecutter-python
Open a console/terminal and run:
Now, you should have generated a new Project for a Python Package, based on the Template!
Just ‘enter’ (cd into) the newly created directory, ie cd <my-great-python-package>.
Try Running the Test Suite!
Read the Documentation’s Use Cases section for more on how to leverage your generated Python Package features.
Free/Libre and Open Source Software (FLOSS)¶
Currently, since the actual cookiecutter template does not reside on the root directory of the repository (but rather in src/cookiecutter_python), ‘cloning’ the repository locally is required at first.
This was demonstrated in the Quickstart section, as well.
For more complex use cases, you can modify the Template and also leverage all of cookiecutter’s features, according to your needs.