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

Function portfolio_report

Solutions/8_1/report.py:45–58  ·  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

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

Callers 1

mainFunction · 0.70

Calls 4

read_portfolioFunction · 0.70
read_pricesFunction · 0.70
make_reportFunction · 0.70
print_reportFunction · 0.70

Tested by

no test coverage detected