Read a CSV file of price data into a dict mapping names to prices.
(filename, **opts)
| 14 | return Portfolio.from_csv(lines, **opts) |
| 15 | |
| 16 | def read_prices(filename, **opts): |
| 17 | ''' |
| 18 | Read a CSV file of price data into a dict mapping names to prices. |
| 19 | ''' |
| 20 | with open(filename) as lines: |
| 21 | return dict(fileparse.parse_csv(lines, types=[str,float], has_headers=False, **opts)) |
| 22 | |
| 23 | def make_report(portfolio, prices): |
| 24 | ''' |