Simple Alameda-Contra Costa Transit District API wrapper
Project description
A simple Alameda-Contra Costa Transit District API wrapper.
License: MIT.
Installation
pip install python-actransit
API
Retrieve a Vehicle Position GTFS-Realtime feed.
from actransit import ACTransit
ac_transit = ACTransit()
realtime_vehicles = ac_transit.gtfsrt.vehicles()
print(realtime_vehicles)
{'entity': [{'id': '1',
'vehicle': {'position': {'bearing': 116.0,
'latitude': 37.80388259887695,
'longitude': -122.276611328125,
'speed': 0.0},
'timestamp': 1579463770,
'trip': {'route_id': '19',
'schedule_relationship': 0,
'trip_id': '751100010'},
'vehicle': {'id': '5020'}}},
# ...
],
'header': {'gtfs_realtime_version': '1.0',
'incrementality': 0,
'timestamp': 1579463788}}
Retrieve a list with information for any existing schedule: current, past and future.
from actransit import ACTransit
ac_transit = ACTransit()
existing_schedules = ac_transit.gtfs.all()
print(existing_schedules)
[{'BookingId': '1912WR',
'EarliestServiceDate': '2019-12-14T00:00:00',
'LatestServiceDate': '2020-03-28T00:00:00',
'UpdatedDate': '2019-12-11T07:45:25.96'},
{'BookingId': '1908FA',
'EarliestServiceDate': '2019-08-10T00:00:00',
'LatestServiceDate': '2019-12-14T00:00:00',
'UpdatedDate': '2019-08-01T15:20:19.587'},
# ...
]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-actransit-0.0.3.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for python_actransit-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 154e0290e2d87341146aa5ef23f9e190b0100f6e9b08623eac02f32f212f6908 |
|
MD5 | 18b400d18486ad4f410ae546059b2ef2 |
|
BLAKE2b-256 | d7c738b8f62744945525225f024bfc79cb9464dcd71d366f30c198f93ef5173c |