pattern_kit
A modern Python library of reusable software design patterns.
Your blueprint for better Python architecture.
pattern_kit is a developer-friendly Python library offering clean, idiomatic implementations of common software design patterns. It focuses on real-world usability, pragmatic APIs, and simple integration into your projects.
While many examples exist online, pattern_kit is designed as a pip-installable, production-grade package with a consistent structure and proper documentation - making design patterns approachable and usable in everyday codebases.
Features
- Clean, idiomatic Python implementations
- Supports both synchronous and asynchronous designs
- Type-annotated and easy to extend
- Ready-to-use patterns for real-world projects
- Extensive documentation with examples
- Zero dependencies - pure Python, clean and portable
Installation
pip install pattern_kit
Documentation
Full usage examples and pattern guides are available in the official documentation
Quick Examples
Singleton example (using decorator)
from pattern_kit import singleton
@singleton
class Config:
def __init__(self, env="dev"):
self.env = env
# you can also use this syntax:
#
# from pattern_kit import Singleton
# class Config(Singleton):
# ...
cfg = Config(env="prod")
print(cfg.env) # "prod"
same = Config()
assert same is cfg
Event (multicast) example
from pattern_kit import Event
def listener(msg):
print(f"[sync] {msg}")
async def async_listener(msg):
print(f"[async] {msg}")
on_message = Event()
on_message += listener
on_message += async_listener
on_message("hello!") # fire-and-forget
await on_message.call_async("world") # fully awaited
Who is this for?
Python developers who want to structure their codebase better and apply solid, proven software architecture principles.
Contributing
Contributions are welcome! Feel free to open issues, suggest improvements, or submit pull requests.
Metadata
Release files for pattern-kit 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pattern_kit-2.0.0.tar.gz | 10.9 kB | Without provenance | Details for pattern_kit-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pattern_kit-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for pattern_kit-2.0.0-py3-none-any.whl |
Total release size: 23.6 kB
Release files / pattern_kit-2.0.0.tar.gz
| Download URL | pattern_kit-2.0.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f6a2812cf6a76fce67933be343cc430ef7622327609a5cd5a5c8edc549770e0
|
|
BLAKE2b-256 checksum How to use checksums |
aaaae0a97730fe3db7f076cea219eccc8641dde53616d2cc966fb33bb2a3503b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / pattern_kit-2.0.0-py3-none-any.whl
| Download URL | pattern_kit-2.0.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e79a7f1d6cac9d7e6ac656764b23639b9e1fba8fc2d07cf580c72cefc01be3bc
|
|
BLAKE2b-256 checksum How to use checksums |
6a66e9a04103753479313120571b745d69a384a8379ca821a2e9d059ed226468
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for pattern-kit 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.