Skip to main content

Python Package Generator

Build Status Coverage Docs Maintainability Release Version Wheel Tech Debt Codacy Supported Versions PyPI Stats Commits Since Tag Commits Since Release License OpenSSF Ruff Black

Create Python Projects swiftly, and enjoy streamlined "DevOps" using a powerful CI/CD Pipeline.

Documentation available at https://python-package-generator.readthedocs.io/.

What's included?

  • Generator of Python Project (see Quickstart), with CLI for Linux, MacOS, and Windows
  • Option to Generate Python Package designed as module, module+cli, or pytest-plugin!
  • Scaffold over 24 files, from Template, to have a ready-to-develop Project equipped with:
    • Fully-featured CI/CD Pipeline, running on Github Actions, defined in .github/
    • Continuous Delivery to PyPI (i.e. pypi.org, test.pypi.org) and Dockerhub
    • Continuous Integration, with Test Suite running pytest, located in the tests dir
    • Continuous Documentation, building with mkdocs or sphinx, and hosting on readthedocs, located in the docs dir
    • Static Type Checking, using mypy
    • Lint Check and Apply commands, using the fast Ruff linter, along with standard isort, and black
    • Build Command, using the build python package

What to expect?

You can be up and running with a new Python Package, and run workflows on Github Actions, such as:

CI Pipeline

  1. CI Pipeline, running on Github Actions, defined in .github/
    • Job Matrix, spanning different platforms and python versions:
      • Platforms: ubuntu-latest, macos-latest
      • Python Interpreters: 3.8, 3.9, 3.10, 3.11, 3.12
    • Parallel Job execution, generated from the matrix, that runs the Test Suite
    • Artifact store of Source and Wheel Distributions, factoring Platform and Python Version

Auto Generated Sample Package Biskotaki

Check the Biskotaki Python Package Project on github, which is Continuously generated by this CLI, for a taste of how a project looks and the files this Template can generate!

Quickstart

To install the latest Generator in your environment, run:

pip install cookiecutter-python

The generate-python CLI should become available in your environment.

Next, create a file, let's call it gen-config.yml, with the following content:

default_context:
    project_name: Demo Generated Project
    project_slug: demo-project
    project_type: module+cli
    full_name: John Doe
    email: john.doe@something.org
    github_username: john-doe
    project_short_description: 'Demo Generated Project Description'
    initialize_git_repo: no
    interpreters: {"supported-interpreters": ["3.8", "3.9", "3.10", "3.11"]}

To generate a Python Package Project, run:

mkdir gen-demo-dir
cd gen-demo-dir

generate-python --config-file ../gen-config.yml --no-input

Now, you should have generated a new Project for a Python Package, based on the Template!

The Project should be located in the newly created demo-generated-project directory.

To leverage all out-of-the-box development operations (ie scripts), install tox:

python3 -m pip install --user 'tox<4'

To verify tox available in your environment, run: tox --version

cd demo-project

To run the Test Suite, run:

tox -e dev

All Tests should pass, and you should see a coverage report!

To run Type Checking against the Source Code, run:

tox -e type

All Type Checks should pass!

To setup a Git Repository, run:

git init
git add .
git checkout -b main
git commit -m "Initial commit"

To setup a Remote Repository, run for example:

git remote add origin <remote-repository-url>
git push -u origin main

To trigger the CI/CD Pipeline, run:

git push

Navigate to your github.com/username/your-repo/actions page, to see the CI Pipeline running!

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

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

Next Steps

To prepare for an Open Source Project Development Lifecycle, you should visit the following websites:

  • PyPI, test.pypi.org, Dockerhub, and Read the Docs, for setting up Release and Documentation Pipelines
  • github.com/your-account to configure Actions, through the web UI
  • Codecov, Codacy, and Codeclimate, for setting up Automated Code Quality, with CI Pipelines
  • https://www.bestpractices.dev/ for registering your Project for OpenSSF Best Practices Badge

Happy Developing!

License

GNU Affero General Public License v3.0

GitHub

Free/Libre and Open Source Software (FLOSS)

OpenSSF

Metadata

Release files for cookiecutter-python 2.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cookiecutter-python 2.7.1
File Size Uploaded
cookiecutter_python-2.7.1.tar.gz 343.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for cookiecutter-python 2.7.1
File Interpreter ABI Platform
cookiecutter_python-2.7.1-py3-none-any.whl Python 3 none any Details
cookiecutter_python-2.7.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 690.8 kB

Release files / cookiecutter_python-2.7.1.tar.gz

Download URL cookiecutter_python-2.7.1.tar.gz
Size 343.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b29b5dfccce135772f53b647389fe403ea436100305092517f0b9904c06fae18
BLAKE2b-256 checksum
How to use checksums
9e063d55b7795ef7751bd67b60ce8cdf92adc9c04452a60c868ceaf4d253b437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / cookiecutter_python-2.7.1-py3-none-any.whl

Download URL cookiecutter_python-2.7.1-py3-none-any.whl
Size 155.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5235381c595ea73d39977ad55adca90972e928b07e7b3006660e00a3d754ebb9
BLAKE2b-256 checksum
How to use checksums
a4a393ad8461791abe2e9cb5d0b2cb198f091ccb0583aaea5959df54b8fc05f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / cookiecutter_python-2.7.1-py2.py3-none-any.whl

Download URL cookiecutter_python-2.7.1-py2.py3-none-any.whl
Size 192.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2bfe53059ab1d58dd292c79f8014d03c85a2eb8394ecbd97ddd1834631ce7df6
BLAKE2b-256 checksum
How to use checksums
6db9eb5ff9739573d7d4200b9d175288434e439d3ee2427a7eb98c0741902e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.7.1 This release

3 release files

2.7.0

3 release files

2.6.3

3 release files

2.6.2

3 release files

2.6.1

3 release files

2.6.0

3 release files

2.5.10

3 release files

2.5.9

3 release files

2.5.8

3 release files

2.5.7

3 release files

2.5.6

3 release files

2.5.5

3 release files

2.5.4

3 release files

2.5.3

3 release files

2.5.2

3 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.15.4

2 release files

1.15.1

2 release files

1.15.0

2 release files

1.14.1

2 release files

1.14.0

2 release files

1.13.0

2 release files

1.12.5

2 release files

1.12.0

2 release files

1.11.4

2 release files

1.11.3

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.2

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page