Converts a Charles Schwab transaction CSV file to a ready-to-import CSV file for Portfolio Performance (PP).
After conversion, this step-by-step guide creates a new portfolio file in PP and imports the converted example CSV.
After importing the converted example CSVThere are two ways to run this tool: Google Colab or via command-line. The former is for end-users. The later is for python-savvy users and developers.
Although Google Colab is free, one will need a Google account.
Runtime Requirements:
- Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.
- Pandas
Install this tool in a Python virtual environment:
Install runtime libraries:
pip install -r requirements.txt
Command-line options:
python convert.py --help
usage: convert.py [-h] [-p PP_CSV] schwab_csv
Converts a Charles Schwab transaction CSV file to a ready-to-import CSV file for Portfolio
Performance.
positional arguments:
schwab_csv Input Charles Schwab CSV file
optional arguments:
-h, --help show this help message and exit
-p PP_CSV, --pp_csv PP_CSV
Resulting CSV file for Portfolio Performance (default: pp.csv)
Example:
An example Schwab CSV: example.csv. The converted ready-to-import CSV file: example_out.csv.
To replicate this conversion:
python convert.py example.csv -p example_out.csv
Supported transactions:
- "NRA Tax Adj"
- "Credit Interest"
- "NRA Withholding"
- "Short Term Cap Gain"
- "Long Term Cap Gain"
- "Cash Dividend"
- "Buy"
- "Wire Received"
- "Wire Sent"1 (Thank you, @ipaulo)
- "Sell" (Not verified)
Not-yet-supported transactions:
- ACH deposit and withdrawal
I have actual transactions for the supported transactions. "Sell" is an educated guess; I don't have an actual sale. If you could share actual transactions for not-yet-supported ones, please let me know. Thank you.
Duplicate transactions:
As far as I can test, PP will detect and skip duplicate transactions. So it is safe to import overlapping transactions in the future.
Dates:
If date is in "date1 as of date2" format, "date1" will be used and "as of date2" will be appended to the resulting "Note" column.
If this project helps your research, don't hesitate to spread the word! Click on the badge below and find citation formats (e.g., BibTeX and etc) at the bottom of that page.
MIT