forked from cswingler/ctabustracker-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctabustracker.html
565 lines (432 loc) · 33 KB
/
ctabustracker.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ctabustracker</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>ctabustracker</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/chris/Projects/cta/ctabustracker/ctabustracker.py">/Users/chris/Projects/cta/ctabustracker/ctabustracker.py</a></font></td></tr></table>
<p><tt><a href="#ctabustracker">ctabustracker</a>.py<br>
<br>
This is a Python module that offers access to all of the data available<br>
in the CTA Bus Tracker API. This is based on the CTA Bus Tracker API<br>
documentation v1.0/rev.2009-12-14, available at:<br>
<a href="http://www.transitchicago.com/asset.aspx?AssetId=2917">http://www.transitchicago.com/asset.aspx?AssetId=2917</a><br>
<br>
The CTA bus tracker API returns data in XML, and this module converts<br>
the information to more sane data structures.<br>
<br>
Note that this does not currently cover L trains, as they do not exist <br>
in the API at the time of creation (Jul 2010). Rumor has it that <br>
it's on its way soon.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="xml.etree.ElementTree.html">xml.etree.ElementTree</a><br>
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
</td><td width="25%" valign=top><a href="urllib2.html">urllib2</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="ctabustracker.html#Pattern">Pattern</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctabustracker.html#Prediction">Prediction</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctabustracker.html#SB_Service">SB_Service</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctabustracker.html#Service_Bulletin">Service_Bulletin</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctabustracker.html#Stop">Stop</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ctabustracker.html#Point">Point</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="ctabustracker.html#Vehicle">Vehicle</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctabustracker.html#ctabustracker">ctabustracker</a>
</font></dt><dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ctabustracker.html#Error">Error</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ctabustracker.html#ImproperNumberOfItemsException">ImproperNumberOfItemsException</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctabustracker.html#InvalidParamtersException">InvalidParamtersException</a>
</font></dt></dl>
</dd>
</dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Base class for exceptions in this module.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ctabustracker.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0xefc40><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
<dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ImproperNumberOfItemsException">class <strong>ImproperNumberOfItemsException</strong></a>(<a href="ctabustracker.html#Error">Error</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="exceptions.html#Exception">Exception</a> raised for lists exceeding preset limits.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ctabustracker.html#ImproperNumberOfItemsException">ImproperNumberOfItemsException</a></dd>
<dd><a href="ctabustracker.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="ImproperNumberOfItemsException-__init__"><strong>__init__</strong></a>(self, numOfItems)</dt></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data descriptors inherited from <a href="ctabustracker.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0xefc40><dd><tt>T.<a href="#ImproperNumberOfItemsException-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="ImproperNumberOfItemsException-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ImproperNumberOfItemsException-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ImproperNumberOfItemsException-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ImproperNumberOfItemsException-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ImproperNumberOfItemsException-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#ImproperNumberOfItemsException-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ImproperNumberOfItemsException-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="ImproperNumberOfItemsException-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="InvalidParamtersException">class <strong>InvalidParamtersException</strong></a>(<a href="ctabustracker.html#Error">Error</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="exceptions.html#Exception">Exception</a> raised if the parameters given to a function are incorrect.<br>
<br>
Attributes:<br>
msg - Message to return.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ctabustracker.html#InvalidParamtersException">InvalidParamtersException</a></dd>
<dd><a href="ctabustracker.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="InvalidParamtersException-__init__"><strong>__init__</strong></a>(self, msg)</dt></dl>
<dl><dt><a name="InvalidParamtersException-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data descriptors inherited from <a href="ctabustracker.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0xefc40><dd><tt>T.<a href="#InvalidParamtersException-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="InvalidParamtersException-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidParamtersException-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="InvalidParamtersException-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidParamtersException-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="InvalidParamtersException-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidParamtersException-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="InvalidParamtersException-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidParamtersException-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="InvalidParamtersException-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="InvalidParamtersException-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidParamtersException-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="InvalidParamtersException-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidParamtersException-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="InvalidParamtersException-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="InvalidParamtersException-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Pattern">class <strong>Pattern</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A <a href="#Pattern">Pattern</a> is a series of Points and related metadata.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Pattern-__init__"><strong>__init__</strong></a>(self, pattern_id, length, direction, points<font color="#909090">=None</font>)</dt><dd><tt>Defines a patern. points can be a list of points, or None.</tt></dd></dl>
<dl><dt><a name="Pattern-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Pattern-append"><strong>append</strong></a>(self, point)</dt><dd><tt>Appends a point to this pattern</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>direction</strong> = ''</dl>
<dl><dt><strong>length</strong> = 0</dl>
<dl><dt><strong>pattern_id</strong> = 0</dl>
<dl><dt><strong>points</strong> = []</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Point">class <strong>Point</strong></a>(<a href="ctabustracker.html#Stop">Stop</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A point is a geographic coordinate, direction, and<br>
related metadata. Many Points make up a <a href="#Pattern">Pattern</a>.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Point-__init__"><strong>__init__</strong></a>(self, seq, ptype, lat, long, stop_id<font color="#909090">=None</font>, stop_name<font color="#909090">=None</font>, pattern_distance<font color="#909090">=None</font>)</dt><dd><tt>Constructor for <a href="#Point">Point</a>.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>pattern_distance</strong> = 0.0</dl>
<dl><dt><strong>ptype</strong> = ''</dl>
<dl><dt><strong>seq</strong> = 0</dl>
<hr>
Methods inherited from <a href="ctabustracker.html#Stop">Stop</a>:<br>
<dl><dt><a name="Point-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>String representation of a <a href="#Stop">Stop</a> object</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="ctabustracker.html#Stop">Stop</a>:<br>
<dl><dt><strong>lat</strong> = 0.0</dl>
<dl><dt><strong>long</strong> = 0.0</dl>
<dl><dt><strong>stop_id</strong> = 0</dl>
<dl><dt><strong>stop_name</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Prediction">class <strong>Prediction</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A prediction is an object holding when a bus is scheduled to arrive at a given stop.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Prediction-__init__"><strong>__init__</strong></a>(self, timestamp, prediction_type, stop_id, stop_name, vehicle_id, distance_to_stop, route, route_dir, destination, predicted_eta, delayed<font color="#909090">=False</font>)</dt></dl>
<dl><dt><a name="Prediction-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Prediction-estimated_time_to_arrival"><strong>estimated_time_to_arrival</strong></a>(self, ctatime<font color="#909090">=None</font>)</dt><dd><tt>Returns the time that the bus is expected to arrive for this <br>
<a href="#Prediction">Prediction</a> (in minutes).<br>
<br>
If ctatime is unspecified, returns ETA based on the system's clock,<br>
otherwise, matches difference against specified time.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>delayed</strong> = False</dl>
<dl><dt><strong>destination</strong> = ''</dl>
<dl><dt><strong>distance_to_stop</strong> = 0</dl>
<dl><dt><strong>mins_to_arrival_at_init</strong> = 0</dl>
<dl><dt><strong>predicted_eta</strong> = None</dl>
<dl><dt><strong>prediction_type</strong> = ''</dl>
<dl><dt><strong>route</strong> = ''</dl>
<dl><dt><strong>route_dir</strong> = ''</dl>
<dl><dt><strong>stop_id</strong> = 0</dl>
<dl><dt><strong>stop_name</strong> = ''</dl>
<dl><dt><strong>timestamp</strong> = None</dl>
<dl><dt><strong>vehicle_id</strong> = 0</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="SB_Service">class <strong>SB_Service</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Service bulletin data for bulletins that affect only a certain subset<br>
of the system<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="SB_Service-__init__"><strong>__init__</strong></a>(self, stop_name, route<font color="#909090">=None</font>, direction<font color="#909090">=None</font>, stop_num<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="SB_Service-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>direction</strong> = ''</dl>
<dl><dt><strong>route</strong> = ''</dl>
<dl><dt><strong>stop_name</strong> = 0</dl>
<dl><dt><strong>stop_num</strong> = 0</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Service_Bulletin">class <strong>Service_Bulletin</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>"<br>
Contains a service bulletin object.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Service_Bulletin-__init__"><strong>__init__</strong></a>(self, name, subject, detail, brief, priority, affected_services<font color="#909090">=[]</font>)</dt></dl>
<dl><dt><a name="Service_Bulletin-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Service_Bulletin-append"><strong>append</strong></a>(self, stop_name, route<font color="#909090">=None</font>, direction<font color="#909090">=None</font>, stop_num<font color="#909090">=None</font>)</dt><dd><tt>Appends an <a href="#SB_Service">SB_Service</a> object to this bulletin</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>affected_services</strong> = []</dl>
<dl><dt><strong>brief</strong> = ''</dl>
<dl><dt><strong>detail</strong> = ''</dl>
<dl><dt><strong>name</strong> = ''</dl>
<dl><dt><strong>priority</strong> = ''</dl>
<dl><dt><strong>subject</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Stop">class <strong>Stop</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Holds information about a stop<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Stop-__init__"><strong>__init__</strong></a>(self, stop_id, stop_name, lat, long)</dt><dd><tt>Creates a Route object</tt></dd></dl>
<dl><dt><a name="Stop-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>String representation of a <a href="#Stop">Stop</a> object</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>lat</strong> = 0.0</dl>
<dl><dt><strong>long</strong> = 0.0</dl>
<dl><dt><strong>stop_id</strong> = 0</dl>
<dl><dt><strong>stop_name</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Vehicle">class <strong>Vehicle</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>An object that holds information about a vehicle.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Vehicle-__init__"><strong>__init__</strong></a>(self, vehicle_id, timestamp, lat, long, heading, pattern_id, pattern_distance, dest, route, delayed<font color="#909090">=False</font>)</dt><dd><tt>Constructor</tt></dd></dl>
<dl><dt><a name="Vehicle-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Thrilling string creation stuff! Just dumps the information out in a readable manner.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>delayed</strong> = False</dl>
<dl><dt><strong>dest</strong> = ''</dl>
<dl><dt><strong>heading</strong> = 0</dl>
<dl><dt><strong>lat</strong> = 0.0</dl>
<dl><dt><strong>long</strong> = 0.0</dl>
<dl><dt><strong>pattern</strong> = None</dl>
<dl><dt><strong>pattern_distance</strong> = 0</dl>
<dl><dt><strong>pattern_id</strong> = 0</dl>
<dl><dt><strong>route</strong> = ''</dl>
<dl><dt><strong>timestamp</strong> = None</dl>
<dl><dt><strong>vehicle_id</strong> = 0</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ctabustracker">class <strong>ctabustracker</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Creates an object that can be used to query Bus Tracker information<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ctabustracker-__init__"><strong>__init__</strong></a>(self, api_key, api_url<font color="#909090">=None</font>)</dt><dd><tt>Initializes the API key for the CTA bus tracker.<br>
This module will not work without a valid key.<br>
If you do not have an API key, you can request one from<br>
<a href="http://www.transitchicago.com/developers/bustracker.aspx">http://www.transitchicago.com/developers/bustracker.aspx</a><br>
<br>
api_url is the base API url to access. If it is not<br>
specified, the default is used:<br>
<a href="http://www.ctabustracker.com/bustime/api/v1/">http://www.ctabustracker.com/bustime/api/v1/</a></tt></dd></dl>
<dl><dt><a name="ctabustracker-getbulletins_route"><strong>getbulletins_route</strong></a>(self, *routes)</dt><dd><tt>Gets bulletins related to routes.</tt></dd></dl>
<dl><dt><a name="ctabustracker-getbulletins_stops"><strong>getbulletins_stops</strong></a>(self, *stopids)</dt><dd><tt>Gets bulletins related to given stop ids.</tt></dd></dl>
<dl><dt><a name="ctabustracker-geteta_from_prediction"><strong>geteta_from_prediction</strong></a>(self, prediction, use_cta_clock<font color="#909090">=True</font>)</dt><dd><tt>Returns the time (in minutes) that a vehicle is<br>
expected to arrive.<br>
<br>
Requires a <a href="#Prediction">Prediction</a> object as a parameter, and<br>
calculates the difference agains the CTA's clock if<br>
use_cta_clock is True. If it is False, it uses the local system's<br>
clock.</tt></dd></dl>
<dl><dt><a name="ctabustracker-getpatterns_pid"><strong>getpatterns_pid</strong></a>(self, *patternids)</dt><dd><tt>Returns patterns given a list of up to 10 pattern ids</tt></dd></dl>
<dl><dt><a name="ctabustracker-getpatterns_rt"><strong>getpatterns_rt</strong></a>(self, route, direction)</dt><dd><tt>Returns a single pattern given a route and direction</tt></dd></dl>
<dl><dt><a name="ctabustracker-getpredictions_stop"><strong>getpredictions_stop</strong></a>(self, *stop_ids)</dt><dd><tt>Returns predictions for the given stop_ids.</tt></dd></dl>
<dl><dt><a name="ctabustracker-getpredictions_vehicle"><strong>getpredictions_vehicle</strong></a>(self, *vehicle_ids)</dt><dd><tt>Returns predictions for the given vehicle_ids</tt></dd></dl>
<dl><dt><a name="ctabustracker-getroute_directions"><strong>getroute_directions</strong></a>(self, route)</dt><dd><tt>Returns a list of directions a given route can go</tt></dd></dl>
<dl><dt><a name="ctabustracker-getroute_stops"><strong>getroute_stops</strong></a>(self, route, direction)</dt><dd><tt>Returns a list of <a href="#Stop">Stop</a> objects on a given route<br>
direction must be a string specifing the direction of the bus.<br>
<br>
The returned list is unordered. Ordering is accomplished<br>
by constructing a pattern.</tt></dd></dl>
<dl><dt><a name="ctabustracker-getroutes"><strong>getroutes</strong></a>(self)</dt><dd><tt>Returns a dict of available routes</tt></dd></dl>
<dl><dt><a name="ctabustracker-gettime"><strong>gettime</strong></a>(self)</dt><dd><tt>Returns the time (as a time object) <br>
as according to the BusTracker system.</tt></dd></dl>
<dl><dt><a name="ctabustracker-getvehicles_rt"><strong>getvehicles_rt</strong></a>(self, *routes)</dt><dd><tt>Retrieves the vehicles available on the specified routes.<br>
Up to 10 routes can be specified.</tt></dd></dl>
<dl><dt><a name="ctabustracker-getvehicles_vid"><strong>getvehicles_vid</strong></a>(self, *vehicleids)</dt><dd><tt>Retrieves bus locations for the given bus IDs. vehicle_ids<br>
can either be a single integer (for one bus) or a list of up to<br>
10 elements.</tt></dd></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-convert_time"><strong>convert_time</strong></a>(timestring)</dt><dd><tt>Converts a CTA time stamp from XML into a<br>
time_struct</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__author__</strong> = 'Chris Swingler'<br>
<strong>__email__</strong> = '[email protected]'<br>
<strong>__status__</strong> = 'Development'<br>
<strong>log</strong> = <logging.Logger instance at 0x6b5198></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">Chris Swingler</td></tr></table>
</body></html>