que/query.py
def data_to_fields(data: FieldDataType, exclude: Any = Nothing) -> FieldList:
    """Convert a dataclass, NamedTuple, dict, or array of tuples to a FieldList.

    Parameters
    --------
    data
        Any data-source which you wish to conver to a list of fields.
    exclude
        Any value or type which you wish to exclude
    """
    if data:
        dict_factory = DictFactory(exclude=exclude)
        if dataclasses.is_dataclass(data):
            data = dataclasses.asdict(data, dict_factory=dict_factory)
        elif isnamedtuple(data):
            data = dict_factory(data._asdict())
        elif isinstance(data, Mapping) or (
            isinstance(data, Collection)
            and all((isinstance(x, Tuple) and len(x) == 2) for x in data)
        ):
            data = dict_factory(data)
        if isinstance(data, dict):
            return FieldList([Field(x, y) for x, y in data.items()])

    raise TypeError(
        "Data must not be empty and be of type dataclass, namedtuple, mapping, "
        f"or collection of tuples whose len is 2. Provided {type(data)}: {data}"
    )
Convert a dataclass, NamedTuple, dict, or array of tuples to a FieldList.

    Parameters
    --------
    data
        Any data-source which you wish to conver to a list of fields.
    exclude
        Any value or type which you wish to exclude
    
Convert a dataclass, NamedTuple, dict, or array of tuples to a FieldList.
Parameters

data
Any data-source which you wish to conver to a list of fields.
exclude
Any value or type which you wish to exclude
Convert a dataclass NamedTuple dict or array of tuples to a FieldList . Parameters data Any data - source which you wish to conver to a list of fields . exclude Any value or type which you wish to exclude
def data_to_fields(data: FieldDataType, exclude: Any = Nothing) -> FieldList:
    if data:
        dict_factory = DictFactory(exclude=exclude)
        if dataclasses.is_dataclass(data):
            data = dataclasses.asdict(data, dict_factory=dict_factory)
        elif isnamedtuple(data):
            data = dict_factory(data._asdict())
        elif isinstance(data, Mapping) or (
            isinstance(data, Collection)
            and all((isinstance(x, Tuple) and len(x) == 2) for x in data)
        ):
            data = dict_factory(data)
        if isinstance(data, dict):
            return FieldList([Field(x, y) for x, y in data.items()])
    raise TypeError(
        "Data must not be empty and be of type dataclass, namedtuple, mapping, "
        f"or collection of tuples whose len is 2. Provided {type(data)}: {data}"
    )
def data_to_fields ( data : FieldDataType , exclude : Any = Nothing ) -> FieldList : if data : dict_factory = DictFactory ( exclude = exclude ) if dataclasses . is_dataclass ( data ) : data = dataclasses . asdict ( data , dict_factory = dict_factory ) elif isnamedtuple ( data ) : data = dict_factory ( data . _asdict ( ) ) elif isinstance ( data , Mapping ) or ( isinstance ( data , Collection ) and all ( ( isinstance ( x , Tuple ) and len ( x ) == 2 ) for x in data ) ) : data = dict_factory ( data ) if isinstance ( data , dict ) : return FieldList ( [ Field ( x , y ) for x , y in data . items ( ) ] ) raise TypeError ( "Data must not be empty and be of type dataclass, namedtuple, mapping, " f"or collection of tuples whose len is 2. Provided {type(data)}: {data}" )
Convert a dataclass, NamedTuple, dict, or array of tuples to a FieldList.
Convert a dataclass NamedTuple dict or array of tuples to a FieldList .
"""Convert a dataclass, NamedTuple, dict, or array of tuples to a FieldList.

    Parameters
    --------
    data
        Any data-source which you wish to conver to a list of fields.
    exclude
        Any value or type which you wish to exclude
    """
data
FieldDataType
exclude
Any