Trips¶
Trips ¶
A class to load and optionally filter GTFS trips data from one or more trips.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) trips data. |
Wraps an already-loaded trips LazyFrame, or leaves it empty for load to fill in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lf
|
Optional[LazyFrame]
|
Optional pre-loaded |
None
|
trip_ids
|
Optional[List[str]]
|
Optional pre-computed list of in-scope |
None
|
Source code in pyGTFSHandler/models/trips.py
load ¶
load(path: Union[str, Path, List[Union[str, Path]]], service_ids: Optional[List[str]] = None, trip_ids: Optional[List[str]] = None, route_ids: Optional[List[str] | LazyFrame | DataFrame] = None, check_files: bool = False, min_file_id=0, collision_registry=None)
Initializes the Trips class by reading and filtering the trips data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path | list[str | Path]
|
One or more paths to directories containing |
required |
service_ids
|
list[str]
|
List of service IDs to filter by. |
None
|
trip_ids
|
list[str]
|
List of trip IDs to filter by. |
None
|
route_ids
|
list[str]
|
List of route IDs to filter by. |
None
|