Last active
July 24, 2019 18:58
-
-
Save mberrien-fitzsimons/bfea418039bc052a8252f4314a8440ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this blog of code allows me to import my secrets file from the conf folder in my | |
# current jupyter notebook | |
root_dir = os.path.join(os.getcwd(), '..') | |
sys.path.append(root_dir) | |
from conf import secrets | |
# Download data as CSV from API | |
function = 'TIME_SERIES_DAILY_ADJUSTED' | |
symbol = 'MSFT' | |
datatype = 'csv' | |
url = f"https://www.alphavantage.co/query?function={function}&symbol={symbol}&\ | |
datatype={datatype}&apikey={ALPHA_VANTAGE_KEY}" | |
msft_raw = pd.read_csv(url) | |
# before making any changes save this to raw data folder | |
msft_raw.to_csv('../data/01_raw/msft_raw.csv', index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment