Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csv2txf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def ConvertTxnListToTxf(txn_list: list[utils.Transaction], tax_year: int, date:
lines.append('V042') # Version
lines.append('Acsv2txf') # Program name/version
if date is None:
date = utils.txfDate(datetime.today())
date = utils.txf_date(datetime.today())
lines.append('D%s' % date) # Export date
lines.append('^')
for txn in txn_list:
Expand Down
4 changes: 2 additions & 2 deletions tdameritrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ def parseFileToTxnList(cls, filename: str, tax_year: Optional[int]) -> list[util
curr_txn.desc = '%s shares %s' % (
cls.numShares(txn_dict), cls.symbol(txn_dict))
buyDate = cls.buyDate(txn_dict)
curr_txn.buyDateStr = utils.txfDate(buyDate)
curr_txn.buyDateStr = utils.txf_date(buyDate)
curr_txn.costBasis = cls.costBasis(txn_dict)
sellDate = cls.sellDate(txn_dict)
curr_txn.sellDateStr = utils.txfDate(sellDate)
curr_txn.sellDateStr = utils.txf_date(sellDate)
curr_txn.saleProceeds = cls.saleProceeds(txn_dict)

assert sellDate >= buyDate, f'Sell date ({sellDate}) must be on or after buy date ({buyDate})'
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __str__(self) -> str:
return ','.join(formatted_data)


def txfDate(date: datetime) -> str:
def txf_date(date: datetime) -> str:
"""Returns a date string in the TXF format, which is MM/DD/YYYY."""
return date.strftime('%m/%d/%Y')

Expand Down
4 changes: 2 additions & 2 deletions vanguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def parseFileToTxnList(cls, filename: str, tax_year: Optional[int]) -> list[util
curr_txn.desc = '%d shares %s' % (
cls.numShares(buy), cls.symbol(buy))
curr_txn.buyDate = cls.date(txn_dict)
curr_txn.buyDateStr = utils.txfDate(curr_txn.buyDate)
curr_txn.buyDateStr = utils.txf_date(curr_txn.buyDate)
curr_txn.costBasis = cls.netAmount(txn_dict)
elif cls.isSell(txn_dict):
sell = txn_dict
Expand All @@ -134,7 +134,7 @@ def parseFileToTxnList(cls, filename: str, tax_year: Optional[int]) -> list[util
continue

sellDate: datetime = cls.date(sell)
curr_txn.sellDateStr = utils.txfDate(sellDate)
curr_txn.sellDateStr = utils.txf_date(sellDate)
curr_txn.saleProceeds = cls.netAmount(sell)

if utils.isLongTerm(buyDate, sellDate):
Expand Down
Loading