MCPcopy Create free account
hub / github.com/dabeaz-course/practical-python / portfolio_report

Function portfolio_report

Solutions/3_2/report.py:63–75  ·  view source on GitHub ↗

Make a stock report given portfolio and price data files.

(portfoliofile,pricefile)

Source from the content-addressed store, hash-verified

61 print('%10s %10d %10.2f %10.2f' % row)
62
63def portfolio_report(portfoliofile,pricefile):
64 '''
65 Make a stock report given portfolio and price data files.
66 '''
67 # Read data files
68 portfolio = read_portfolio(portfoliofile)
69 prices = read_prices(pricefile)
70
71 # Create the report data
72 report = make_report_data(portfolio,prices)
73
74 # Print it out
75 print_report(report)
76
77portfolio_report('../../Work/Data/portfolio.csv',
78 '../../Work/Data/prices.csv')

Callers 1

report.pyFile · 0.70

Calls 4

read_portfolioFunction · 0.70
read_pricesFunction · 0.70
make_report_dataFunction · 0.70
print_reportFunction · 0.70

Tested by

no test coverage detected