Skip to main content

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)

Uploaded Source

Built Distribution

python_actransit-0.0.3-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page