Skip to content

type

Dataclass to organize and convert the data type of a Record's detail.

Classes:

  • FieldType

    Organize and convert the data types of a Record's detail.

FieldType dataclass

FieldType()

Organize and convert the data types of a Record's detail.

Methods:

  • from_detail

    Extract the field type from a record's detail.

  • to_pydantic

    Convert Heurist field type to Python type.

  • to_sql

    Convert a Heurist data type label (i.e. "enum") to an SQL equivalent.

from_detail classmethod

from_detail(detail: dict) -> str

Extract the field type from a record's detail.

Parameters:

  • detail

    (dict) –

    Record's detail.

Returns:

  • str ( str ) –

    Field type name.

to_pydantic classmethod

to_pydantic(datatype: str) -> Any

Convert Heurist field type to Python type.

Parameters:

  • datatype

    (str) –

    Field type name.

Returns:

  • Any ( Any ) –

    Python type.

to_sql classmethod

to_sql(datatype: str) -> str

Convert a Heurist data type label (i.e. "enum") to an SQL equivalent.

Parameters:

  • datatype

    (str) –

    Heurist data type.

Returns:

  • str ( str ) –

    SQL data type.