normalize_broker_csv
Convert raw broker CSV exports into standardized transactions for ACB and capital gains. Maps column aliases, cleans numbers, returns transactions and skipped rows.
Instructions
Convert a raw broker activity export into transactions the other tools accept.
Broker exports rarely match the documented headers. This tool maps common column aliases ("Trade Date", "Activity Type", "Symbol", "Quantity", ...), keeps only buy/sell rows (reinvestment/DRIP rows count as buys, since they add to ACB), cleans number formats ("1,200", "$9.99", parenthesized negatives, signed quantities), and returns ready-to-use 'transactions' plus a per-row 'skipped' list (dividends, deposits, transfers, unparseable rows) with reasons, so nothing is dropped silently. Pass the export as 'csv_path' (CSV/TSV/JSON) or inline as 'rows'. Feed the returned transactions straight into calculate_acb, capital_gains_report or unrealized_gains.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| csv_path | No |