Skip to content

render_value

Classes

RenderInstruction (KiaraModel) pydantic-model

Source code in kiara/models/render_value/__init__.py
class RenderInstruction(KiaraModel):
    @classmethod
    @abc.abstractmethod
    def retrieve_source_type(cls) -> str:
        pass

    @classmethod
    def retrieve_supported_target_types(cls) -> Iterable[str]:

        result = []
        for attr in dir(cls):
            if len(attr) <= 11 or not attr.startswith("render_as__"):
                continue

            attr = attr[11:]
            target_type = attr[0:]
            result.append(target_type)

        return result
retrieve_source_type() classmethod
Source code in kiara/models/render_value/__init__.py
@classmethod
@abc.abstractmethod
def retrieve_source_type(cls) -> str:
    pass
retrieve_supported_target_types() classmethod
Source code in kiara/models/render_value/__init__.py
@classmethod
def retrieve_supported_target_types(cls) -> Iterable[str]:

    result = []
    for attr in dir(cls):
        if len(attr) <= 11 or not attr.startswith("render_as__"):
            continue

        attr = attr[11:]
        target_type = attr[0:]
        result.append(target_type)

    return result

RenderMetadata (KiaraModel) pydantic-model

Source code in kiara/models/render_value/__init__.py
class RenderMetadata(KiaraModel):

    related_instructions: Dict[str, RenderInstruction] = Field(
        description="Related instructions, to be used by implementing frontends as hints.",
        default_factory=dict,
    )

Attributes

related_instructions: Dict[str, kiara.models.render_value.RenderInstruction] pydantic-field

Related instructions, to be used by implementing frontends as hints.

RenderValueResult (tuple)

RenderValueResult(rendered, metadata)

Source code in kiara/models/render_value/__init__.py
class RenderValueResult(NamedTuple):

    rendered: Any
    metadata: RenderMetadata
metadata: RenderMetadata
rendered: Any