Skip to main content

Template for new Python projects.

Project description

PythonTemplateIt

Category Status and Links
General
CD/CI
PyPI
GitHub

Short description

PythonTemplateIt is a reusable template for Python projects with standardized packaging, linting, testing, environment bootstrapping, and GitHub workflow automation.


Module Overview

Key Features

  • Poetry-based project packaging and dependency management.
  • Pre-configured quality tooling (black, isort, flake8, pytest, pre-commit).
  • PowerShell scripts for local setup, private repository access, and Docker-assisted database provisioning.
  • Reusable CI/CD workflows for pull request validation and post-merge release/publish handling.
  • Release note and versioning conventions aligned to SemVer.

Project Structure

  • src/: Application modules and package source code.
  • tests/: Unit and functional test suites with fixtures and test data.
  • scripts/: SQL/bootstrap assets.
  • legacy/: Archived or excluded legacy resources.
  • *.ps1: Setup and automation scripts for environment and toolchain tasks.

Getting Started

Prerequisites

  • Python 3.12+
  • Poetry
  • Docker (optional, for local MySQL service)
  • GitHub access token(s) for private package sources when needed

Setup

# 1) Generate .env from the SetupDotEnv script
.\SetupDotEnv.ps1

# 2) Configure private repository access for Poetry
.\SetupPrivateRepoAccess.ps1

# 3) Optional: configure GitHub CLI access
.\SetupGitHubAccess.ps1

# 4) Install and sync development dependencies
.\InstallDevEnv.ps1

# 5) Optional: start local MySQL service
.\SetUpDocker.ps1
# or
# docker compose up -d db

# 6) Run tests
poetry run pytest

Common Commands

poetry install
poetry run pytest
poetry run pytest --cov=src --cov=tests --cov-report=term-missing
poetry run black src tests
poetry run isort src tests
poetry run flake8 src tests
poetry run pre-commit run --all-files

Automation Scripts

  • Install.ps1: Bootstraps Poetry tooling and installs dependencies.
  • InstallDevEnv.ps1: Installs development dependencies and configures pre-commit tooling.
  • SetupDotEnv.ps1: Generates .env values from environment variables.
  • SetupPrivateRepoAccess.ps1: Configures private package source credentials.
  • SetupGitHubAccess.ps1: Configures GitHub authentication for local automation.
  • SetUpDocker.ps1: Provisions Docker resources used by database-related workflows.
  • CreateDbSqlScript.ps1: Generates SQL bootstrap scripts for MySQL setup.

Active Workflows

  • .github/workflows/py-temp-pr-pub-no_docker-def.yaml: Pull request validation workflow.
  • .github/workflows/py-temp-publish-pub-build_release_notify_after_merge-def.yaml: Release build, publish, and notification workflow after merge to master.

Project details


Download files

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

Source Distribution

pythontemplateit-0.6.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

pythontemplateit-0.6.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pythontemplateit-0.6.0.tar.gz.

File metadata

  • Download URL: pythontemplateit-0.6.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.11 Linux/6.11.0-1018-azure

File hashes

Hashes for pythontemplateit-0.6.0.tar.gz
Algorithm Hash digest
SHA256 10f1edec380423c96905ad9855e176d6f3be3a00318076b1c48cb0dbcb650072
MD5 4e68382b7f27b3eac0814d61accf71b5
BLAKE2b-256 0b94c088dc00cb2cd4706bdc2fa8525c7f32e400caad97605a7a7f9c95964c29

See more details on using hashes here.

File details

Details for the file pythontemplateit-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: pythontemplateit-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.11 Linux/6.11.0-1018-azure

File hashes

Hashes for pythontemplateit-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4115124ede588754d5678a15d2f0ab8659791367c395725abeabcdbc6b9a360
MD5 edce775b7fc52afd2ecad0240d9b4051
BLAKE2b-256 2d956a6c9aa04f11dcdfa34f0bd207fb94025f6a758a072a5f95f891b9a8999e

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