# faif/python-patterns

A collection of design patterns/idioms in Python

Repository: https://github.com/faif/python-patterns
Canonical: https://ross.abutalabs.com/products/python-patterns
Language: Python
License Family: other
Topics: python, idioms, design-patterns
Last push: 2026-08-20T09:10:58+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 35, longevity 100
- inputs: {"age_days": 5201, "days_push": 13, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 42946, forks 6993 (observed 2026-08-28T04:12:08.889097+00:00)

## What it is
A curated collection of classic design patterns and Python-specific idioms implemented as small, annotated Python examples. It covers creational, structural, and behavioral patterns with explanations of trade-offs.

## Use cases
- learn how to implement the singleton or factory pattern in Python
- find Pythonic idioms for common design patterns
- study examples of builder, adapter, and decorator patterns
- reference for software design pattern implementations
- prepare for interviews about design patterns in Python

## When to choose
- you want concise, runnable examples of design patterns in Python
- you are learning or teaching object-oriented design with Python
- you need a quick reference for pattern trade-offs

## When to avoid
- you need a production-ready pattern library to import as a dependency
- you work in a language other than Python
- you need officially maintained, licensed code for commercial use (no license is provided)

## Facets
- artifact type: learning-resource
- maturity: active
- function: developer-tools, documentation
- domain: developer-tools, tutorials, programming-languages
- platform: python
- tags: design-patterns, idioms, python, educational, code-examples

## Member repositories
- faif/python-patterns (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:12:08.889097+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:22:36.347975+00:00, confidence not recorded.
  - readme: https://github.com/faif/python-patterns (fetched 2026-08-28T04:12:08.889097+00:00, sha 0cb323148232)
- Data as of 2026-08-30T08:39:29.467469+00:00.
