forked from dabeaz-course/practical-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusing_report.py
More file actions
33 lines (24 loc) · 771 Bytes
/
using_report.py
File metadata and controls
33 lines (24 loc) · 771 Bytes
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 report as r
import stock
pf_file = '.\\Data\\portfolio.csv'
price_file = '.\\Data\\prices.csv'
# pf_files = ['.\\Data\\portfolio.csv', '.\\Data\\portfolio2.csv']
# for file in pf_files:
# print(f'{file:-^43s}')
# r.portfolio_report(file, price_file)
# print()
# read portfolio and print it (just Portfolio object so nothing much to print)
portfolio = r.read_portfolio(pf_file)
print(portfolio)
# make default report with txt formatter
print(f'{pf_file:-^43s}')
r.portfolio_report(pf_file, price_file)
print()
# html formatter
r.portfolio_report(pf_file, price_file, 'html')
print()
# and csv formatter
r.portfolio_report(pf_file, price_file, 'csv')
print()
# r.portfolio_report(pf_file, price_file, 'aku_ankka')
# r.portfolio_report(pf_file)