MCPcopy Index your code
hub / github.com/dabeaz-course/practical-python / portfolio_report

Function portfolio_report

Solutions/4_10/report.py:49–62  ·  view source on GitHub ↗

Make a stock report given portfolio and price data files.

(portfoliofile, pricefile, fmt='txt')

Source from the content-addressed store, hash-verified

47 formatter.row(rowdata)
48
49def portfolio_report(portfoliofile, pricefile, fmt='txt'):
50 '''
51 Make a stock report given portfolio and price data files.
52 '''
53 # Read data files
54 portfolio = read_portfolio(portfoliofile)
55 prices = read_prices(pricefile)
56
57 # Create the report data
58 report = make_report_data(portfolio, prices)
59
60 # Print it out
61 formatter = tableformat.create_formatter(fmt)
62 print_report(report, formatter)
63
64def main(args):
65 if len(args) != 4:

Callers 1

mainFunction · 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