Pampy is a library for pattern matching in Python, inspired by Haskell and OCaml. It provides concise syntax for matching patterns against data structures, including lists, dictionaries, and custom objects. The current stable version is 0.3.0, released in 2019. The library is in maintenance mode with low release cadence.
pip install pampyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic pattern matching with Pampy using match() function.
Import _ from pampy and use it as wildcard.
Always put the most specific patterns first and a catch-all _ last.
Refer to Pampy's documentation for correct pattern syntax.
Consider using Python 3.10+ built-in match statement or alternative libraries.
Use: from pampy import _
Use: match(data, pattern1, result1, pattern2, result2, ...)
Ensure dictionary patterns have keys that exist. Use _ for optional keys with a default branch.
No dependency data recorded yet.