nectarengine.utils module

class nectarengine.utils.Cond

Bases: object

Helper for constructing Hive Engine query conditions (Mongo-style operators).

static gt(value: Any) Dict[str, Any]

Greater than ($gt).

static gte(value: Any) Dict[str, Any]

Greater than or equal ($gte).

static in_list(values: List[Any]) Dict[str, Any]

In list ($in).

static lt(value: Any) Dict[str, Any]

Less than ($lt).

static lte(value: Any) Dict[str, Any]

Less than or equal ($lte).

static ne(value: Any) Dict[str, Any]

Not equal ($ne).

static nin(values: List[Any]) Dict[str, Any]

Not in list ($nin).

class nectarengine.utils.Query

Bases: object

Helper for constructing dictionary queries.

static match(**kwargs: Any | Dict[str, Any]) Dict[str, Any]

Construct a query dictionary from keyword arguments.

Example:

Query.match(account=”hive-engine”, _id=Cond.gt(10)) # Returns: {‘account’: ‘hive-engine’, ‘_id’: {‘$gt’: 10}}