Skip to content

Commit

Permalink
skip Y accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Oct 7, 2024
1 parent cd90e67 commit 125aa7d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fidelityAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,15 @@ def getAccountInfo(self):
raise Exception("Not enough elements in fidelity positions csv")

for row in reader:
# Skip empty rows
if row["Account Number"] is None:
continue
# Last couple of rows have some disclaimers, filter those out
if row["Account Number"] is not None and "and" in str(
row["Account Number"]
):
if "and" in row["Account Number"]:
break
# Skip accounts that start with 'Y' (Fidelity managed)
if row["Account Number"][0] == "Y":
continue
# Get the value and remove '$' from it
val = str(row["Current Value"]).replace("$", "")
# Get the last price
Expand Down

0 comments on commit 125aa7d

Please sign in to comment.