Read a CSV file of price data into a dict mapping names to prices.
(filename)
| 19 | return Portfolio(portfolio) |
| 20 | |
| 21 | def read_prices(filename): |
| 22 | ''' |
| 23 | Read a CSV file of price data into a dict mapping names to prices. |
| 24 | ''' |
| 25 | with open(filename) as lines: |
| 26 | return dict(fileparse.parse_csv(lines, types=[str,float], has_headers=False)) |
| 27 | |
| 28 | def make_report_data(portfolio, prices): |
| 29 | ''' |