Factory Extraction

Functions to extract BaseFactory instances from modules:

FactoryInfo


def FactoryInfo(
    name:str, factory:BaseFactory, doc:str, module_name:str
)->None:

Information about a discovered factory instance.


extract_factories_from_module


def extract_factories_from_module(
    module:Any, # The module to extract factories from
    module_name:str, # The name of the module
)->List: # List of FactoryInfo objects

Extract all BaseFactory instances from a module.


list_all_factories


def list_all_factories(
    
)->Dict: # Dictionary mapping module names to their factories

List all factory instances across all utility modules.


list_module_factories


def list_module_factories(
    module_name:str, # Name of the module to inspect (e.g., 'spacing', 'sizing')
)->List: # List of FactoryInfo objects for the module

List all factory instances in a specific utility module.


get_factory_by_name


def get_factory_by_name(
    module_name:str, # Name of the module
    factory_name:str, # Name of the factory (e.g., 'p', 'w', 'flex')
)->Optional: # FactoryInfo object or None if not found

Get a specific factory by module name and factory name.

Export