Type part of a bus stop's name; get the next departures from it, from VIA's published schedule.
python3 main.py "houston & st mary"
python3 main.py "medical & babcock" --count 15The first run downloads VIA's schedule, a 6 MB GTFS zip, and keeps it beside the script. GTFS is the format every transit agency publishes and every trip planner reads, so what you learn here works for any city.
It reads five files from the zip: stops.txt (where), stop_times.txt (when each trip reaches each stop), trips.txt and routes.txt (which bus), and calendar.txt with calendar_dates.txt (which days a schedule runs, including holidays).
- Realtime. VIA publishes live vehicle positions, trip updates and alerts as GTFS-realtime, a protobuf format:
pip install gtfs-realtime-bindingsreads it. The feeds are served over plainhttp://, so a web app onhttps://needs a small proxy in between: a serverless function works. - A map.
shapes.txtis every route's line. Draw them with Leaflet or MapLibre. - Walk sheds. Which neighborhoods are more than a quarter mile from a stop with frequent service? Combine stops with the County's census block groups.
- A departure board for a lobby, a library or a coworking space.
VIA's data is licensed for uses that help transit riders, and that's what this starter is. Credit VIA as "Data provided by VIA Metropolitan Transit". Don't use VIA's logos or trademarks, and don't present your project as VIA's or as a partnership with VIA. Full summary in ATTRIBUTION.md; the license itself is on VIA's developer page.
Data provided by VIA Metropolitan Transit