Skip to content

JDougherty/mbtapy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MBTApy

Description

MBTApy is a wrapper around the MBTA-REALTIME API (v2)

Dependencies

See requirements.txt

Documentation

Detailed documentation is not yet available.

Example code to get all upcoming trips for a given mode of transportation:

    import mbtapy
    apiobj = mbtapy.MbtaApi()
    routes = apiobj.get_routes_by_mode("Commuter Rail")
    for route in routes:
        schedules = apiobj.get_schedule_by_route(route)
        print "Route: %s" % route
        print "  Upcoming schedules:"
        for direction in schedules:
            print "  Direction: %s" % direction.direction_name
            for trip in schedules[direction]:
                print "    ", trip.trip_name
                for stop_id, tripstop_obj in trip.stops.items():
                    print "      %s (%s)" % (tripstop_obj.stop_name, tripstop_obj.sch_arr_dt_datetime())

The API specification is available directly from the MBTA.

Licensing and Copyright

MBTApy is licensed under the Apache License v2.0. See included LICENSE for more information.

Copyright© 2015 Joseph W. Dougherty

About

Python bindings for the MBTA-REALTIME API (v2)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages