rxmxn / pycoin

0 stars 0 forks source link

Create a config architecture to manage passwoerds api_keys, etc #14

Open cyberguilletell opened 4 years ago

cyberguilletell commented 4 years ago

I notice when I try to run the project that I need an environment variable for AlphaVantage API key

(pycoin_env2) cyberguille@Predator:~/Projects/pycoin$ python run.py 
Traceback (most recent call last):
  File "run.py", line 27, in <module>
    a = AlphaVantage(args.currency)
  File "/home/cyberguille/Projects/pycoin/coin/alphavantage.py", line 12, in __init__
    self.cc = CryptoCurrencies(key=alphavantage_key, output_format='json')
  File "/home/cyberguille/VirtualEnvs/pycoin_env2/lib/python3.6/site-packages/alpha_vantage/alphavantage.py", line 50, in __init__
    raise ValueError('The AlphaVantage API key must be provided '
ValueError: The AlphaVantage API key must be provided either through the key parameter or through the environment variable ALPHAVANTAGE_API_KEY. Get a free key from the alphavantage website: https://www.alphavantage.co/support/#api-key

In fact in the file alfphavantage.py in one line of code we have

alphavantage_key = os.getenv('ALPHAVANTAGE_KEY')

So we need to add that to our environmental variables on our OS

Tasks

rxmxn commented 4 years ago

Just added some info in the README about the env vars that need to be set