Filters¶
Typed builders for the filter query parameter. See the pagination and filtering guide.
Helpers to build Pennylane list filters.
The Pennylane API filters list endpoints through a filter query parameter
containing a JSON array of conditions::
[{"field": "date", "operator": "gteq", "value": "2026-01-01"}]
This module provides typed helpers so you never have to hand-write that JSON:
from pennylane_sdk import filters
client.customer_invoices.list(
filter=[filters.gte("date", "2026-01-01"), filters.eq("status", "upcoming")],
)
Supported operators (availability varies by field, see the endpoint docs):
eq, not_eq, lt, lteq, gt, gteq, in, not_in.
Filter
dataclass
¶
Filter(
field: str,
operator: str,
value: FilterValue | list[FilterValue],
)
A single filter condition (field, operator, value).
where ¶
where(
field: str,
operator: str,
value: FilterValue | list[FilterValue],
) -> Filter
Build a filter with an arbitrary operator.
encode_filters ¶
encode_filters(filters: FiltersInput) -> str
Encode filters into the JSON string the API expects.
Accepts a single :class:Filter, a raw dict, a list mixing both, or an
already-encoded JSON string (returned unchanged).