Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (25 sloc) 816 Bytes
import pynance as pn
import pandas as pd
import os
def get_quotes():
cwd = os.getcwd()
ticker = True
print("retrieving stock Data: \n")
beggin = input("Beggining date seperated by dashes, i.e. 07-07-2017 \n ")
end = input("End date seperated by dashes ,i.e. 07-07-2017 \n ")
tickers = input("Ticker of stocks sperated by colmas and a space, i.e. AAPL , GE \n")
details = tickers.split(",")
t = 0
for i in details:
i = i.strip()
t += 1
if t == 1 :
data_use = pn.data.get(i, beggin, end)
data_use["Ticker"] = i
else:
temp = pn.data.get(i, beggin, end)
temp["Ticker"] = i
tot = [data_use, temp]
data_use = pd.concat(tot)
data_use.to_csv(cwd+ "/current.csv")
get_quotes()