Skip to main content

What is DesignKit?

DesignKit is a modern Python architecture toolkit that draws inspiration from the 23 Gang of Four design patterns with original architectural abstractions, expressive APIs, and efficient utilities to build cleaner, more maintainable software.

Every API is carefully designed with developer experience in mind, featuring first-class support for async/await, metaprogramming, extensibility hooks, multiple programming paradigms, operator overloading where appropriate, and other modern Python capabilities.

[!IMPORTANT] DesignKit does not aim to provide literal implementations of the Gang of Four patterns. Instead, it offers expressive APIs inspired by those ideas, redesigned to solve real-world Python architecture problems while embracing modern language features.

Write software that's easier to understand, extend, and maintain!

What DesignKit Is Not?

DesignKit is not:

  • an application framework.
  • an inversion-of-control container.
  • an ORM.
  • a web framework.
  • a dependency injection framework.
  • a replacement for your existing architecture.

Basically, there is no such thing as a design pattern for creating a payment agent. Instead, it is a toolkit of architectural APIs that you can adopt independently, wherever they make sense.

How to Use DesignKit?

To start using DesignKit, you first need to install it.

# via pip
pip install designkit

# via uv
uv install designkit

# via poetry
poetry add designkit

So, you can import the DesignKit library in your Python code with the following statement:

from designkit.<section>.<pattern> import <utilities>, <exceptions>, <abstractions>

# Example:
from designkit.behavioral.state import (
    StateMachine, # implementation
    Reactive, # utility
    GuardRejectedError, InvalidTransitionError # exceptions
)

Where <section> is the section of the design pattern (e.g., behavioral, creational, structural), <pattern> is the name of the design pattern (e.g., matcher, factory, adapter), and <utilities>, <exceptions>, and <abstractions> are the specific utilities, exceptions, and abstractions you want to use from that pattern.

[!IMPORTANT] To see most examples of usage, you can check samples/ directory on GitHub with at least one example for each design pattern.

Features

DesignKit features all 23 Gang of Four (GoF) design patterns, plus 6 original design patterns.

Design Patterns

  • Behavioral

    1. Chain of Responsibility
      • Author: GoF, Sheñey
      • Description: Passes a request along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.
      • Example: ...
    2. Command
      • Author: GoF, Sheñey
      • Description: Encapsulates a request as an object, thereby allowing for parameterization of clients with queues, requests, and operations.
      • Example: ...
    3. Interpreter
      • Author: GoF, Sheñey
      • Description: Given a language, defines a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
      • Example: ...
    4. Iterator
      • Author: GoF, Sheñey
      • Description: Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
      • Example: ...
    5. Mediator
      • Author: GoF, Sheñey
      • Description: Defines an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
      • Example: ...
    6. Memento
      • Author: GoF, Sheñey
      • Description: Without violating encapsulation, captures and externalizes an object's internal state so that the object can be restored to this state later.
      • Example: ...
    7. Observer
      • Author: GoF, Sheñey
      • Description: Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
      • Example: ...
    8. State
      • Author: GoF, Sheñey
      • Description: Allows an object to alter its behavior when its internal state changes. The object will appear to change its class.
      • Example: ...
    9. Strategy
      • Author: GoF, Sheñey
      • Description: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
      • Example: ...
    10. Policy
      • Author: GoF, Sheñey
      • Description: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. Policy lets the algorithm vary independently from clients that use it.
      • Example: ...
    11. Template Method
      • Author: GoF, Sheñey
      • Description: Defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
      • Example: ...
    12. Visitor
      • Author: GoF, Sheñey
      • Description: Represents an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.
      • Example: ...
  • Creational

    1. Abstract Factory
      • Author: GoF, Sheñey
      • Description: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
      • Example: ...
    2. Builder
      • Author: GoF, Sheñey
      • Description: Separates the construction of a complex object from its representation, allowing the same construction process to create different representations.
      • Example: ...
    3. Factory Method
      • Author: GoF, Sheñey
      • Description: Defines an interface for creating an object, but lets subclasses alter the type of objects that will be created.
      • Example: ...
    4. Prototype
      • Author: GoF, Sheñey
      • Description: Specifies the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
      • Example: ...
    5. Singleton -- Only one instance.
      • Author: GoF, Sheñey
      • Description: Ensures a class has only one instance and provides a global point of access to it.
      • Example: ...
  • Structural

    1. Adapter
      • Author: GoF, Sheñey
      • Description: Converts the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
      • Example: ...
    2. Bridge
      • Author: GoF, Sheñey
      • Description: Decouples an abstraction from its implementation so that the two can vary independently.
      • Example: ...
    3. Composite
      • Author: GoF, Sheñey
      • Description: Composes objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
      • Example: ...
    4. Decorator
      • Author: GoF, Sheñey
      • Description: Attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
      • Example: ...
    5. Facade
      • Author: GoF, Sheñey
      • Description: Provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
      • Example: ...
    6. Flyweight
      • Author: GoF, Sheñey
      • Description: Uses sharing to support large numbers of fine-grained objects efficiently.
      • Example: ...
    7. Proxy
      • Author: GoF, Sheñey
      • Description: Provides a surrogate or placeholder for another object to control access to it.
      • Example: ...

Tech Stack

Technology Purpose
🎨 Rich Rich text and beautiful formatting in the terminal
🔤 DesignKit Utils Utility functions and helpers for DesignKit

Getting Started

# clone the repository
git clone https://github.com/Sheniey/designkit.git
cd designkit

# install dependencies
pip install -r requirements.txt # via pip
uv install -r requirements.txt  # via uv

Commands

Command Action
maturin develop Start development build of Crates
maturin build Build production release of Crates to ./target/
maturin publish Publish entire project to PyPI -- future deprecation
pytest Run all tests in the project -- requires pytest to be installed

Contributing

See CONTRIBUTING.md for details on how to contribute to this project.

License

Licensed under the MIT License © 2026 Sheñey.

Release files for designkit 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for designkit 0.1.2
File Size Uploaded
designkit-0.1.2.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for designkit 0.1.2
File Interpreter ABI Platform
designkit-0.1.2-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details

Total release size: 1.5 MB

Release files / designkit-0.1.2.tar.gz

Download URL designkit-0.1.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
d39748b328ed827af2dd537d610c50032a452b62820fe20404ac586c59a76f48
BLAKE2b-256 checksum
How to use checksums
afae86ea6e35795d847762d5b770ddda468dfa1e66f144a1e5572b5f51084ce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / designkit-0.1.2-cp314-cp314-win_amd64.whl

Download URL designkit-0.1.2-cp314-cp314-win_amd64.whl
Size 299.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
9abb6a0a1e18ea63990e4e4bf5e85f1af87a1c1ff7bf99c7835fd09817b7ffe1
BLAKE2b-256 checksum
How to use checksums
c4d17ef1b0acf6a835f0b48010a6324bff1111f73057a350fcff67665c808eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page