Skip to content

prescriptiveanalytics/python-package-template

Repository files navigation

Poetry Cookiecutter

A simple Cookiecutter template for scaffolding Python packages and apps. The goal is to provide sane defaults for any application.

Batteries Included

  • Packaging and dependency management with Poetry
  • Ready to use CUDA DEVCONTAINER with devcontainers
  • Task running with Poe the Poet
    • Pre defined tasks
    • Code formatting with Black, isort
    • Code linting with Ruff
    • Tests and test coverage with Pytest
  • Scaffolding updates with Cookiecutter and Cruft
  • Documentation generation with Mkdocs and mkdocstrings
  • Simple Gitignore for working with Python / PyCharm / VSCode / ...
  • Default EditorConfig for Python and miscellaneous files
  • Uses Google-style docstrings or NumPy-style
  • Ready to use Docker images as a base CI/CD
  • Cross-platform support for Linux, macOS (Apple silicon and Intel), and Windows

Planned

Usage

Creating a new Python project

  1. Install Cruft and Cookiecutter
  2. Run:
    cruft create -f https://github.com/prescriptiveanalytics/python-package-template
  3. Ensure poetry.lock file is generated (by running poetry install)
  4. Install the environment with poetry install and create a container using docker build -f Dockerfile-test .
  5. [Optional] Update your project template by running cruft update

Parameters

Parameter Description
package_name
"My Awesome Proect"
The name of the package. Will be slugified to snake_case for importing and kebab-case for installing.
package_description
"A single sentence description"
A single-line description of the package.
package_url
"https://gitdma.risc-software.at//<package_name>"
The URL to the package's repository.
author_name
"Sonja Sunshine"
The full name of the primary author of the package.
author_email
"[email protected]"
The email address of the primary author of the package.
python_version
"3.11"
The minimum Python version that the package requires.
docstring_style
["Google", "Numpy"]
Whether to use and validate NumPy-style or Google-style docstrings.

Supported Poe Tasks

  • precommit Runs formatting, linting, and import sorting
  • check Checks if formatting, linting and import sorting are corrcet
  • test Runs all unit tests and doctests
  • docs Serves documentation in the docs folder, also generates API docs from docstrings

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages