Routes¶
Routes ¶
A class to load and optionally filter GTFS routes data from one or more routes.txt files using Polars LazyFrame.
Attributes:
| Name | Type | Description |
|---|---|---|
paths |
List[Path]
|
List of directory paths containing |
lf |
LazyFrame
|
A Polars LazyFrame containing the (optionally filtered) routes data. |
Wraps an already-loaded routes LazyFrame, or leaves it empty for load to fill in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lf
|
Optional[LazyFrame]
|
Optional pre-loaded |
None
|
route_ids
|
Optional[List[str]]
|
Optional pre-computed list of in-scope |
None
|
Source code in pyGTFSHandler/models/routes.py
load ¶
load(path: Union[str, Path, List[Union[str, Path]]], route_ids: Optional[List[str] | LazyFrame | DataFrame] = None, route_types: Optional[List[int]] = None, check_files: bool = False, min_file_id=0, collision_registry=None)
Initializes the Routes class by reading and filtering the routes data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path | list[str | Path]
|
One or more paths to directories containing |
required |
route_ids
|
list[str]
|
List of route IDs to filter by. |
None
|