-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (24 loc) · 1.03 KB
/
main.py
File metadata and controls
32 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import formulas as f
import pandas as pd
def main():
"""Please enter the ticker"""
t = input("Please enter the ticker you would like to obtain information from: ")
t = t.upper()
#Create all the dataframes for each set of information
#b_s, rat = f.balance_sheet(t)
#c_f = f.cash_flow(t)
#i_s = f.income_statement(t)
o, des = f.overview(t)
p = f.price(t)
#Download all the data into an excel
with pd.ExcelWriter(t+'.xlsx') as writer:
des.to_excel(writer, sheet_name= 'Description')
p.to_excel(writer, sheet_name='Price')
o.to_excel(writer, sheet_name= 'Overview')
#i_s.to_excel(writer, sheet_name= 'Income Statement')
#b_s.to_excel(writer, sheet_name= 'Balance Sheet')
#rat.to_excel(writer, sheet_name= 'Balance Sheet', startrow= 1, startcol= 8)
#c_f.to_excel(writer, sheet_name= 'Cash Flow')
print('An Excel file has been created for you with all the data from the ticker', t)
if __name__ == '__main__':
main()