Hello, thanks for the useful code to navigate the burgh!.
I tried the very first example and I got this output.
'''
api = BustimeAPI(key)
api.vehicles(rt=88)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/pghbustime/interface.py", line 179, in vehicles
return self.response(url)
File "/usr/local/lib/python3.5/dist-packages/pghbustime/interface.py", line 87, in response
return self.parseresponse(resp)
File "/usr/local/lib/python3.5/dist-packages/pghbustime/interface.py", line 115, in parseresponse
if self.RESPONSE_TOKEN not in resp:
TypeError: a bytes-like object is required, not 'str'
'''
This is a Python 3 issue. requests returns the content of a request in the bytes type, not the str type in Python 3. I added a small fix which runs resp.decode if the module is run on Py3.
Hello, thanks for the useful code to navigate the burgh!.
I tried the very first example and I got this output. '''
thanks!