Skip to main content

Yet another modern Python Package (pypi) with emphasis in CI/CD and automation.

Project description

Cookiecutter Python Package

Python Package (pypi) Cookiecutter, with emphasis on CI/CD and automation.

GitHub Workflow Status (branch) Read the Docs (version) Codecov OpenSSF Maintainability Better Code Hub Codacy Code Climate technical debt Black
Production Version PyPI - Wheel Supported Python versions GitHub GitHub commits since tagged version (branch) GitHub commits since latest release (by SemVer)

Features

  1. Fresh Python Package Project Generation, “packaged” with a Test Suite and a CI Pipeline (see Quickstart)

  2. Python Package Template (source code at src/cookiecutter_python/) implemented as a Cookiecutter

  3. Tested on python versions 3.6, 2.7, 3.8, 3.9 and 3.10, for both “Linux” and “MacOS” platforms (see Test Workflow on CI)

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:

Source Code hosted on Github at https://github.com/boromir674/biskotaki
Python Package hosted on pypi.org at https://pypi.org/project/biskotaki/
CI Pipeline hosted on Github Actions at https://github.com/boromir674/biskotaki/actions

Generated Python Package Features

  1. Test Suite, using pytest, located in tests dir

  2. Parallel Execution of Unit Tests, on multiple cpu’s

  3. Documentation Pages, hosted on readthedocs server, located in docs dir

  4. Automation, using tox, driven by single tox.ini file

    1. Code Coverage measuring

    2. Build Command, using the build python package

    3. Pypi Deploy Command, supporting upload to both pypi.org and test.pypi.org servers

    4. Type Check Command, using mypy

    5. Lint Check and Apply commands, using isort and black

  5. CI Pipeline, running on Github Actions, defined in .github/

    1. Job Matrix, spanning different platform’s and python version’s

      1. Platforms: ubuntu-latest, macos-latest

      2. Python Interpreters: 3.6, 3.7, 3.8, 3.9, 3.10

    2. Parallel Job execution, generated from the matrix, that runs the Test Suite

Quickstart

Installation

Usage

Open a console/terminal and run:

generate-python

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>.

Develop your package’s Source Code (business logic) inside src/my_great_python_package dir :)
Develop your package’s Test Suite (ie unit-tests, integration tests) inside tests dir :-)

Try Running the Test Suite!

tox

Read the Documentation’s Use Cases section for more on how to leverage your generated Python Package features.

License

GitHub

Free/Libre and Open Source Software (FLOSS)

OpenSSF

Notes

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.

Project details


Release history Release notifications | RSS feed

This version

1.4.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cookiecutter_python-1.4.0.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cookiecutter_python-1.4.0-py3-none-any.whl (106.3 kB view details)

Uploaded Python 3

File details

Details for the file cookiecutter_python-1.4.0.tar.gz.

File metadata

  • Download URL: cookiecutter_python-1.4.0.tar.gz
  • Upload date:
  • Size: 89.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/4.11.4 packaging/21.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.10

File hashes

Hashes for cookiecutter_python-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d3f89d1dbca731c933e2a5c2916fb82769b7f9e8d4851c2aef19c41c1d168327
MD5 07c82d7d422238d1461f40dd1ee9a267
BLAKE2b-256 3b923367a6eca4217c36874164061b485ab874d2ed07adfb3243c85973ba64b2

See more details on using hashes here.

File details

Details for the file cookiecutter_python-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: cookiecutter_python-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 106.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/4.11.4 packaging/21.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.10

File hashes

Hashes for cookiecutter_python-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b009d4826dc406dc7715997b8aa3ae0f1de3ab7da79e17792db33b5f373b9f9
MD5 93e2ecf4c4c4d03500c52c7af2e2ca65
BLAKE2b-256 97761aadc8f3abace2e263c09e78de291bd3c3ac333d2eb5242d5931882873fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page