Skip to content

Commit c987a55

Browse files
committed
Fixes #2
1 parent c60e2f0 commit c987a55

34 files changed

+38
-24
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ After conversion, this [step-by-step guide](./guide/README.md) creates a new por
1111

1212
<figure>
1313
<img
14-
src="https://github.com/rlan/convert-csv-schwab2pp/raw/main/guide/img/100.jpg"
14+
src="https://github.com/rlan/convert-csv-schwab2pp/raw/main/guide/img/100.png"
1515
alt="Guide step 100">
1616
<figcaption>After importing the converted example CSV</figcaption>
1717
</figure>

convert.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333

3434

3535
# A Charles Scwab CSV starts with a prefix and a suffix row
36-
# Prefix: "Transactions for account...
36+
# Prefix: "Transactions for account..."
3737
# Suffix: "Transactions Total"
38+
# They are ignored.
3839
df = pd.read_csv(args.schwab_csv, skiprows=1, skipfooter=1, engine="python")
3940

4041
# Convert dates to datetime objects
@@ -70,6 +71,13 @@ def remove_currency(text: str):
7071
df["Transaction Currency"] = transaction_currency
7172

7273
# Convert Action to Type
74+
"""
75+
"Deposit/Removal (or withdrawal): Depositing or withdrawing funds will
76+
respectively increase or decrease the value of a deposit account."
77+
Ref: https://help.portfolio-performance.info/en/reference/transaction/
78+
79+
So a Schwab "Wire Sent" is a PP "Removal".
80+
"""
7381
action_to_type = {
7482
"NRA Tax Adj": "Taxes",
7583
"Credit Interest": "Interest",
@@ -80,6 +88,7 @@ def remove_currency(text: str):
8088
"Buy": "Buy",
8189
"Sell": "Sell",
8290
"Wire Received": "Deposit",
91+
"Wire Sent": "Removal",
8392
"Advisor Fee": "Fees",
8493
"Reinvest Dividend": "Dividend",
8594
"Reinvest Shares": "Buy",
@@ -105,6 +114,8 @@ def convert_security_name(data: str):
105114
return ""
106115
elif data.startswith("WIRED FUNDS RECEIVED"):
107116
return ""
117+
elif data.startswith("WIRED FUNDS DISBURSED"):
118+
return ""
108119
else:
109120
return data
110121

example.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"Transactions for account ...000 as of 09/27/2022 02:03:53 AM ET"
22
"Date","Action","Symbol","Description","Quantity","Price","Fees & Comm","Amount"
3+
"01/01/2024","Wire Sent","","WIRED FUNDS DISBURSED","","","","-$100.00"
34
"12/29/2021","NRA Withholding","BNDX","VANGUARD TOTAL INTERNATIONAL BND ETF","","","","-$0.14"
45
"12/29/2021","Short Term Cap Gain","BNDX","VANGUARD TOTAL INTERNATIONAL BND ETF","","","","$0.48"
56
"12/29/2021","Long Term Cap Gain","BNDX","VANGUARD TOTAL INTERNATIONAL BND ETF","","","","$29.21"

example_out.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Date,Note,Ticker Symbol,Security Name,Shares,Fees,Value,Transaction Currency,Type
2+
2024-01-01,Wire Sent,,,,,-100.00,USD,Removal
23
2021-12-29,NRA Withholding,BNDX,VANGUARD TOTAL INTERNATIONAL BND ETF,,,-0.14,USD,Taxes
34
2021-12-29,Short Term Cap Gain,BNDX,VANGUARD TOTAL INTERNATIONAL BND ETF,,,0.48,USD,Dividend
45
2021-12-29,Long Term Cap Gain,BNDX,VANGUARD TOTAL INTERNATIONAL BND ETF,,,29.21,USD,Dividend

guide/README.md

+23-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A step-by-step guide
22

3-
This guide will create a new portfolio file in Portfolio Performance (PP) and import a converted CSV file.
3+
This guide will create a new portfolio file in Portfolio Performance (PP) and import a converted CSV file. Screen capturse are from PP 0.71.2 (October 2024).
44

55
1. Download a transcations CSV file from your Charles Schwab account, say, ```example.csv```.
66
2. Convert the CSV. [README](../README.md) for convert.py.
@@ -11,60 +11,61 @@ python3 convert.py example.csv -p example_out.csv
1111

1212
3. Open Portfolio Performance and click on "Create a new file".
1313

14-
![Create a new file](img/010.jpg "Click on Create a new file")
14+
![Create a new file](img/010.png "Click on Create a new file")
1515

1616
4. Select "USD (United States Dollar)" for currency.
1717

18-
![USD (United States Dollar)](img/020.jpg "Select 'USD (United States Dollar)' for currency.")
18+
![USD (United States Dollar)](img/020.png "Select 'USD (United States Dollar)' for currency.")
1919

2020
5. Type "Securities" for Securities Account and "Deposit" for Reference Account. Then click on "Add" button.
2121

22-
![Securities and Deposit accounts](img/030.jpg)
22+
![Securities and Deposit accounts](img/030.png)
2323

2424
6. Click on "Finish" button.
2525

26-
![Finish](img/040.jpg)
26+
![Clikd on Finish](img/040.png)
2727

2828
7. Import the converted CSV. Go to File menu, Import, CSV files (comma-seperated values) and select ```example_out.csv```.
2929

30-
![Setup online retirieval of securities quotes](img/050.jpg)
30+
![File menu, Import, CSV files](img/050.png)
3131

3232
8. Click on "Next" button.
3333

34-
![Click on "Next" button](img/060.jpg)
34+
![Click on "Next" button](img/060.png)
3535

3636
9. Note that "Deposit" is chosen as the Cash Account and "Securities" as the Securities Account. These two names where entered in a previous step. Click on "Finish" button.
3737

38-
![Click on "Finish" button](img/070.jpg)
38+
![Click on "Finish" button](img/070.png)
3939

40-
10. Now we are going to setup online retrieval of securities quotes for the securities in the account.
40+
10. Click on "OK" button.
4141

42-
1. To have online quotes, we need to access an online service via its API key. FinnHub, among others, are supported by PP. Create an account on [Finnhub](https://finnhub.io/) and get your API key.
42+
![Click on "OK" button](img/080.png)
4343

44-
2. Enter this API key at Preferences, API Keys, Finnhub, Finnhub API Key. You only need to enter an API key once. New portfolio files created in PP will be able to use it.
45-
46-
![Finnhub API key](img/080.jpg)
47-
48-
11. Now we are going to activate online quotes for securities that exist in the account.
44+
11. Now we are going to retrieve historial quotes for securities that exist in the account.
4945

5046
1. Select "All Securities" from the tree menu on the left panel.
5147

52-
![Select "All Securities"](img/090.jpg)
48+
![Select "All Securities"](img/090.png)
5349

5450
2. Right click on "VANGUARD TOTAL INTERNATIONAL BND ETF" and choose "Edit".
5551

56-
![Right click and choose Edit](img/091.jpg)
52+
![Right click and choose Edit](img/091.png)
5753

5854
3. Select "Historical Quotes" tab.
5955

60-
![Select Historical Quotes tab](img/092.jpg)
56+
![Select Historical Quotes tab](img/092.png)
57+
58+
4. Choose "Yahoo" from the Provider dropdown list.
59+
60+
![Choose Yahoo from the Provider dropdown list](img/093.png)
6161

62-
4. Choose "Finnhub" from the Provider drop list. Historical prices will then be retrieved. Then click on "OK" button.
62+
5. Historical quotes will be retrieved. Then click on "OK" button.
6363

64-
![Choose Finnhub from the Provider drop list](img/093.jpg)
64+
![Historical quotes retrieved](img/094.png)
65+
![Chart of historical quotes](img/095.png)
6566

66-
5. Repeat this for other securities in the account. Note that this only needs to be done once for each new securities in the account. For example, repeat this when a new security is purchased. PP will retrieve historical prices automatically or you can manually do so via Online menu, Update Quotes.
67+
6. Repeat this for other securities in the account. Note that this only needs to be done once for each new securities in the account. For example, repeat this when a new security is purchased. PP will retrieve historical quotes automatically or you can manually do so via Online menu, Update Quotes.
6768

6869
12. Verify. Select "All transcations" from the tree menu on the left panel. Import complete.
6970

70-
![Select All transactions](img/100.jpg)
71+
![Select All transactions](img/100.png)

guide/img/010.jpg

-306 KB
Binary file not shown.

guide/img/010.png

362 KB
Loading

guide/img/020.jpg

-318 KB
Binary file not shown.

guide/img/020.png

441 KB
Loading

guide/img/030.jpg

-299 KB
Binary file not shown.

guide/img/030.png

406 KB
Loading

guide/img/040.jpg

-300 KB
Binary file not shown.

guide/img/040.png

410 KB
Loading

guide/img/041.png

390 KB
Loading

guide/img/050.jpg

-266 KB
Binary file not shown.

guide/img/050.png

126 KB
Loading

guide/img/060.jpg

-337 KB
Binary file not shown.

guide/img/060.png

294 KB
Loading

guide/img/070.jpg

-351 KB
Binary file not shown.

guide/img/070.png

265 KB
Loading

guide/img/080.jpg

-253 KB
Binary file not shown.

guide/img/080.png

349 KB
Loading

guide/img/090.jpg

-253 KB
Binary file not shown.

guide/img/090.png

367 KB
Loading

guide/img/091.jpg

-283 KB
Binary file not shown.

guide/img/091.png

465 KB
Loading

guide/img/092.jpg

-278 KB
Binary file not shown.

guide/img/092.png

456 KB
Loading

guide/img/093.jpg

-388 KB
Binary file not shown.

guide/img/093.png

489 KB
Loading

guide/img/094.png

528 KB
Loading

guide/img/095.png

438 KB
Loading

guide/img/100.jpg

-361 KB
Binary file not shown.

guide/img/100.png

441 KB
Loading

0 commit comments

Comments
 (0)