Bus data¶
Methods for retrieving data about buses, stops and routes in the L.A. Metro system.
Stops¶
- client.bus.stops.get(id)¶
Return the stop with the provided Metro identifer.
>>> from la_metro import LAMetro >>> client = LAMetro() >>> client.bus.stops.get(6033) <BusStop: Santa Monica / Vermont>
- stop_obj.id¶
The identifier in the Metro system
- stop_obj.name¶
The name of the bus stop
- stop_obj.latitute¶
The y coordinate of the stop’s location
- stop_obj.longitude¶
The x coordinate of the stop’s location
- stop_obj.y¶
Alias to the latitude of the stop’s location
- stop_obj.x¶
Alias to the longitude of the stop’s location
- stop_obj.wkt¶
The stop’s location in Well-Known Text format
- stop_obj.geojson¶
The stop’s location in GeoJSON format
- stop_obj.messages¶
Returns an messages Metro has left for users of this bus stop. This can contain information about service problems and delays.
- stop_obj.predictions¶
Returns a list of predictions that guess when busses will next arrive at this stop.
- stop_obj.routes¶
Returns a list of the routes that connect with this bus route.
Routes¶
- client.bus.routes.all()¶
Return all routes in the Metro system
>>> from la_metro import LAMetro >>> client = LAMetro() >>> client.bus.routes.all() [<BusRoute: 2>, <BusRoute: 4>, <BusRoute: 10>, <BusRoute: 14>, <BusRoute: 16>, <BusRoute: 18>, <BusRoute: 20>, <BusRoute: 26>, <BusRoute: 28>, <BusRoute: 30> ...]
- client.bus.routes.get(id)¶
Return the route with the provided Metro identifer.
>>> from la_metro import LAMetro >>> client = LAMetro() >>> client.bus.routes.get(704) <BusRoute: 704>
- route_obj.id¶
The identifier in the Metro system
- route_obj.name¶
The name of the bus route
- route_obj.runs¶
Returns a list of the runs on this bus route.
- route_obj.stops¶
Returns a list of the stops on this bus route in their proper order.
- route_obj.vehicles¶
Returns a list of the vehicles on this bus route with their latest positions.
Vehicles¶
- client.bus.vehicles.all()¶
Return all vehicles out in the Metro system
>>> from la_metro import LAMetro >>> client = LAMetro() [<BusVehicle: 3129>, <BusVehicle: 6735>, <BusVehicle: 7433>, <BusVehicle: 6729>, <BusVehicle: 9270>, <BusVehicle: 6758>, <BusVehicle: 7071>, <BusVehicle: 9306>, <BusVehicle: 8206>, <BusVehicle: 8314> ...]
- client.bus.vehicles.get(id)¶
Return the vehicle with the provided Metro identifer.
>>> from la_metro import LAMetro >>> client = LAMetro() >>> client.bus.vehicles.get(7433) <BusVehicle: 7433>
- vehicle_obj.id¶
The identifier in the Metro system
- vehicle_obj.seconds_since_report¶
The time since the data on this vehicle was last updated
- vehicle_obj.is_predictable¶
The boolean indicator related to whether or not the busses arrival time can be predicted that I do not understand
- vehicle_obj.id
The identifier in the Metro system
- vehicle_obj.latitute¶
The y coordinate of the vehicle’s location
- vehicle_obj.longitude¶
The x coordinate of the vehicle’s location
- vehicle_obj.y¶
Alias to the latitude of the vehicle’s location
- vehicle_obj.x¶
Alias to the longitude of the vehicle’s location
- vehicle_obj.wkt¶
The vehicle’s location in Well-Known Text format
- vehicle_obj.geojson¶
The vehicle’s location in GeoJSON format
- vehicle_obj.heading¶
- vehicle_obj.route¶
The route the vehicle is on.
- vehicle_obj.run¶
The run the vehicle is on.
Runs¶
- run_obj.id¶
The identifier in the Metro system
- run_obj.name¶
The name of the bus run
- run_obj.direction¶
The direction the run is going along the route
- run_obj.route¶
The route the run is on.
Predictions¶
- prediction_obj.stop¶
The stop this prediction is estimating an arrival for
- prediction_obj.route¶
The route the prediction is estimating an arrival for
- prediction_obj.run¶
The run the prediction is estimating an arrival for
- prediction_obj.minutes¶
The estimated arrival time in minutes
- prediction_obj.seconds¶
The estimated arrival time in seconds
- prediction_obj.is_departing¶
A boolean indicator I do not understand