Welcome to the Sweet Tea Factory System! This guide will help you get up and running quickly.
# Clone the repository
git clone https://github.com/snoodleboot-io/sweet_tea.git
cd sweet_tea
# Install dependencies
uv sync
# Run tests to verify installation
uv run pytest
# Install from PyPI
pip install sweet-tea
# Or for development
git clone https://github.com/snoodleboot-io/sweet_tea.git
cd sweet_tea
pip install -e .
# Clone the repository
git clone https://github.com/snoodleboot-io/sweet_tea.git
cd sweet_tea
# Build with Hatchling
python -m build
# Install the built package
pip install dist/sweet_tea-0.1.2.tar.gz
# Clone the repository
git clone https://github.com/snoodleboot-io/sweet_tea.git
cd sweet_tea
# Install with Poetry
poetry install
# Run tests
poetry run pytest
The Sweet Tea Factory System provides three main components:
from sweet_tea import Registry, Factory
# Define a simple class
class HelloWorld:
def __init__(self, message="Hello, World!"):
self.message = message
def greet(self):
return self.message
# Register the class
Registry.register("hello", HelloWorld)
# Create an instance
greeter = Factory.create("hello", configuration={"message": "Hi there!"})
print(greeter.greet()) # Output: Hi there!
For larger projects, you can enable automatic class registration:
# In your package's __init__.py
from sweet_tea.registry import Registry
# This will scan and register all classes in the package
Registry.fill_registry()
# Now you can create instances of any class in the package
instance = Factory.create("my_class_name")