Skip to content

generator

dandy.intel.generator

IntelClassGenerator

from_callable_signature classmethod

Source code in dandy/intel/generator.py
@classmethod
def from_callable_signature(
        cls,
        callable_: Callable
) -> Type[BaseIntel]:

    typed_kwargs = get_typed_kwargs_from_callable_signature(
        callable_
    )

    return cls.from_typed_kwargs(
        f'{callable_.__name__}Intel',
        typed_kwargs,
    )

from_simple_json_schema classmethod

Source code in dandy/intel/generator.py
@classmethod
def from_simple_json_schema(
        cls,
        simple_json_schema: dict | str,
        class_name: str = 'SimpleJsonSchemaIntel',
) -> Type[BaseIntel]:
    typed_kwargs = get_typed_kwargs_from_simple_json_schema(
        simple_json_schema,
    )

    return cls.from_typed_kwargs(
        class_name,
        typed_kwargs,
    )

from_typed_kwargs staticmethod

Source code in dandy/intel/generator.py
@staticmethod
def from_typed_kwargs(
        intel_class_name: str,
        typed_kwargs: TypedKwargs
) -> Type[BaseIntel]:
    return create_model(
        intel_class_name,
        __base__=BaseIntel,
        **typed_kwargs
    )