pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/rundef/pattern_kit

nonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-0b53c3bf3393e2ed.css" /> GitHub - rundef/pattern_kit: A modern Python library of reusable software design patterns. Your blueprint for better Python architecture.
Skip to content

A modern Python library of reusable software design patterns. Your blueprint for better Python architecture.

License

Notifications You must be signed in to change notification settings

rundef/pattern_kit

Repository files navigation

pattern_kit

PyPI - Version No dependencies CI Documentation PyPI - Downloads

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.

About

A modern Python library of reusable software design patterns. Your blueprint for better Python architecture.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy