Read a stock portfolio file into a list of dictionaries with keys name, shares, and price.
(filename, **opts)
| 6 | import tableformat |
| 7 | |
| 8 | def read_portfolio(filename, **opts): |
| 9 | ''' |
| 10 | Read a stock portfolio file into a list of dictionaries with keys |
| 11 | name, shares, and price. |
| 12 | ''' |
| 13 | with open(filename) as lines: |
| 14 | return Portfolio.from_csv(lines, **opts) |
| 15 | |
| 16 | def read_prices(filename, **opts): |
| 17 | ''' |
no test coverage detected