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

Function portfolio_report

Solutions/7_4/report.py:51–64  ·  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

49 formatter.row(rowdata)
50
51def portfolio_report(portfoliofile, pricefile, fmt='txt'):
52 '''
53 Make a stock report given portfolio and price data files.
54 '''
55 # Read data files
56 portfolio = read_portfolio(portfoliofile)
57 prices = read_prices(pricefile)
58
59 # Create the report data
60 report = make_report_data(portfolio, prices)
61
62 # Print it out
63 formatter = tableformat.create_formatter(fmt)
64 print_report(report, formatter)
65
66def main(args):
67 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