Nasdaq / data-link-python

A Python library for Nasdaq Data Link's RESTful API
MIT License
445 stars 73 forks source link

api_config: avoid whitespace issues in config #11

Closed couture-ql closed 2 years ago

couture-ql commented 2 years ago

When users create add their API Key to a config file it is possible that whitespace accidentally added into the file will cause issues when constructing the URI. Fix API call failures by trying harder to remove whitespace in the file. Ensure read_key() will strip whitespace and only use the first line.

Signed-off-by: Jamie Couture jamie.couture@nasdaq.com

couture-ql commented 2 years ago

This still needs some work as we don't want to create files if they don't exist -- tests leave dirty files -- and will need to deal with the case where next() could raise StopIteration