impuls.selector

class impuls.selector.Routes(agency_id: str | None = None, type: Type | None = None, ids: Container[str] | None = None)

Bases: object

Routes helps narrow down a particular set of routes from the whole database.

Default selector (selector.Routes()) picks all routes. All further restrictions are applied simultaneously/are logically ANDed.

find(db: DBConnection) Iterable[Route]

find generates all Routes which match this selector.

find_ids(db: DBConnection) Iterable[str]

find_ids generates all Route ids which match this selector.

agency_id: str | None = None

agency_id restricts the routes selector to only routes belonging to an Agency identified by this id.

ids: Container[str] | None = None

ids restricts the routes selector to only routes with a specific id.

type: Type | None = None

type restricts the routes selector to only route with a specific Type.