datapoint-python
datapoint-python copied to clipboard
Problem setting API key
Hi there.
Firstly, thanks so much for creating this API wrapper - it's really useful.
I created a project using it about 2 years ago, and it worked beautifully.
However I'm now trying to make some amendments to that project, and I'm struggling to set my API key.
My project is a flask powered web app, so before launching the app I set an environmental variable:
METOFFICE_API_KEY=NNNNNNN-XXXX-YYYY-ZZZZ-AAAABBBBCCCC
I then have the following code to create a connection, per your examples:
metOfficeApiKey = os.environ.get("METOFFICE_API_KEY")
connection = datapoint.connection(api_key=metOfficeApiKey)
I'm getting the following error:
ValueError: Profile not found in /Users/Matt/Library/Application Support/DataPoint/default.key. Please install your API key with datapoint.profile.install_API_key("<YOUR-KEY>")
I'm still pretty new in web development so I'm not sure why I'm getting this error - could be because I've messed up my python environment? I'd hugely appreciate any thought you have on how to address this. Thanks so much in advance!