How do I connect to the API ?

72 views
Skip to first unread message

CJ Landry

unread,
Mar 11, 2018, 3:29:45 PM3/11/18
to Brewery DB API
I am just learning how to code in python and came across the BreweryDB API and thought it would be nice to try it out.  I have received my API key, but I m not sure how to connect.  I have set up a python (anaconda) file in sublime text editor with the following code and Im trying to run it in Terminal but i am getting the error message below.  I don't know what I am doing wrong and would appreciate some help. 

from brewerydb import *

BreweryDb.configure(api_key='mike',end_point='http://api.brewerydb.com/v2/?mykey')


BreweryDb.breweries({'geo':1,
                 'lat':47.6097,
    'lng':-122.3331,
                     'radius':30,
                     'units':'m'})

print(breweries)


This is the error message I receive: 

File "brews.py", line 2, in <module>

    from brewerydb import *

ModuleNotFoundError: No module named 'brewerydb'




Thanks

CJ




Reply all
Reply to author
Forward
0 new messages