preheat_open.query

Query Module for Object Filtering and Retrieval

This module provides classes and functions for querying objects based on specified criteria. It supports filtering objects by attributes, nested object querying, and unique element retrieval.

Classes:

Query: Represents a query for filtering objects based on specified attributes NoElementError: Raised when no elements are found in a generator NoUniqueElementError: Raised when multiple elements are found where one is expected

Functions:

build_instance_from_dict: Builds class instances from dictionaries query_stuff: Queries objects and their sub-objects recursively unique: Returns the unique element from a generator

Functions

build_instance_from_dict(cls, data[, ...])

Build an instance of a dataclass from a dictionary.

query_stuff(obj, query, sub_obj_attrs[, ...])

Recursively query objects and their sub-objects based on specified criteria.

unique(generator)

Return the unique element from a generator.

Classes

Query([exclude])

Represents a query for filtering objects based on specified attributes.

Exceptions

NoElementError

Exception raised when no elements are found in a generator.

NoUniqueElementError

Exception raised when multiple elements are found where one is expected.