We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68e0128 commit 83251e2Copy full SHA for 83251e2
1 file changed
examples/schedule_for_route.py
@@ -0,0 +1,21 @@
1
+from helpers.load_env import load_settings
2
+
3
+from onebusaway import OnebusawaySDK
4
5
+# Load settings from .env file, if it exists. If not, we'll use the
6
+# Puget Sound server URL (which is also the default in the SDK) and
7
+# the 'TEST' API key.
8
+settings = load_settings(
9
+ {
10
+ "api_key": "TEST",
11
+ "base_url": "https://api.pugetsound.onebusaway.org/",
12
+ }
13
+)
14
15
+# Create a new instance of the OneBusAway SDK with the settings we loaded.
16
+oba = OnebusawaySDK(**settings)
17
18
+route_id = "1_100224"
19
+response = oba.schedule_for_route.retrieve(route_id)
20
+if response and response.data:
21
+ print(response.data.entry.stop_trip_groupings[0])
0 commit comments