A simple script to download stock data from alphavantage.co. Specifically it is setup to download the NASDAQ top 500.
Dependencies:
cd DSD
sudo python setup.py install
Get a free API key from AlphaVantage
export the API key as an environmental variable. I recommend just adding it to your bashrc so it is always available.
echo "export ALPHA_VANTAGE_KEY=<Your API Key Here>" >> ~/.bashrc
#Should look somthing like "export ALPHA_VANTAGE_KEY=AHKDSFJHUDFDJD"
source ~/.bashrc
from dsd import download_nasdaq_data as dnd
'''
Downloads multiple companies
'''
dnd.downloadNTopMarketCapCompanies(500, output_dir='stock_data')
'''
Given a stock symbol (aka 'tsla') will download and save the data to the
output dir as a csv
'''
dnd.download_symbol(symbol, output_dir, retry_count=4)
Have fun.