Skip to main content

pypaginate.specs

Filter / sort / search specifications + boolean-group builders.

The data shapes are generated from the Rust core's JSON Schema (see pypaginate._generated.types); this module re-exports them and adds the And / Or builders with construction-time nesting-depth validation and a validated search_spec factory — both delegating their limits to the core.

And

def And(*conditions: FilterSpec | FilterGroup) -> FilterGroup

Build an AND group of conditions (validates nesting depth at construction).

Or

def Or(*conditions: FilterSpec | FilterGroup) -> FilterGroup

Build an OR group of conditions (validates nesting depth at construction).

search_spec

def search_spec(spec: SearchSpec) -> SearchSpec

Validate a search spec's query length against the core limit, then return it.