# santinic/pampy

Pampy: The Pattern Matching for Python you always dreamed of.

Repository: https://github.com/santinic/pampy
Canonical: https://ross.abutalabs.com/products/pampy
Language: Python
License: MIT
License Family: permissive
Topics: python, python3, pattern-matching, functional, lisp-interpreter
Last push: 2025-01-16T12:13:52+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 1, release rhythm 8, longevity 100
- inputs: {"age_days": 2855, "days_push": 594, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3523, forks 123 (observed 2026-08-28T04:08:07.983058+00:00)

## What it is
Pampy is a small (~150 line) Python library providing pattern matching, letting you match values against literals, types, tuples, lists, dicts, and wildcards with lambda handlers. It supports nested structures, HEAD/TAIL list matching, and REST arguments.

## Use cases
- add pattern matching to python code
- match nested dicts and lists in python
- write a lisp interpreter in python
- replace if-else chains with pattern matching
- destructure lists with head and tail in python

## When to choose
- you want readable, functional-style dispatch over data structures in Python 3
- you need to match deeply nested lists, tuples, or dicts concisely

## When to avoid
- you're on Python 3.10+, which has native structural pattern matching (match/case)
- you need maximum performance in hot code paths

## Facets
- artifact type: library
- maturity: maintenance
- function: parser, developer-tools
- domain: programming-languages, developer-tools
- platform: python, cross-platform
- tags: pattern-matching, functional-programming, structural-matching, algorithms

## Member repositories
- santinic/pampy (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:07.983058+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-29T18:35:11.806289+00:00, confidence not recorded.
  - readme: https://github.com/santinic/pampy (fetched 2026-08-28T04:08:07.983058+00:00, sha 37a1d584bba5)
  - registry_pypi: https://pypi.org/pypi/pampy/json (fetched 2026-08-29T09:29:14.644981+00:00, sha 95d2055750a1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
