A comprehensive, production-ready Python factory pattern implementation with advanced features for building extensible applications.
__class_getitem__# Using uv (recommended)
uv add sweet-tea
# Using pip
pip install sweet-tea
# Using Poetry
poetry add sweet-tea
from sweet_tea import Factory, AbstractFactory, Registry
# Register a class
Registry.register("my_service", MyServiceClass)
# Create instances
instance = Factory.create("my_service", configuration={"param": "value"})
# Use type-safe abstract factories
service_factory = AbstractFactory[BaseService]
instance = service_factory.create("implementation")
We welcome contributions! See our contributing guide for details.
Copyright © 2025 snoodleboot, LLC. Licensed under the Apache License 2.0.