diff options
author | uvok | 2025-04-16 20:33:35 +0200 |
---|---|---|
committer | uvok | 2025-04-16 20:33:35 +0200 |
commit | 8bd47f31bb497b2f8a39f048d4e8cc8a0123d6f1 (patch) | |
tree | a51272301fb563e150a6657ad7d937398af902a3 | |
parent | 94280c01909083edfea44c0a4223173cca3565c2 (diff) |
Doubt deposit/withdraw, logging again
-rw-r--r-- | bla.py | 40 | ||||
-rw-r--r-- | trade_queue.py | 2 |
2 files changed, 23 insertions, 19 deletions
@@ -14,7 +14,7 @@ logging.basicConfig(level=logging.INFO) # Set up a dedicated logger for FIFOQueue logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) +logger.setLevel(logging.ERROR) def generate_report(sale_entries, proceeds: float | Decimal, crypto_asset, date_sold): @@ -106,27 +106,31 @@ def process_ledger(read_actions: List[LedgerAction], output_path: str): elif action.type == "deposit" and action.asset != "EUR": assert len(actions) == 1 - currency = action.asset - fifo_queues.setdefault(currency, FIFOQueue()) - amount = Decimal(action.amount) - price = 0 - current = fifo_queues[currency] + logger.error("Don't know how do handle deposits yet.") + # currency = action.asset + # fifo_queues.setdefault(currency, FIFOQueue()) + # amount = Decimal(action.amount) + # price = 0 + # current = fifo_queues[currency] - # remove transaction fees - # (but only if it has a previous withdraw, or rather, if these are coins from a previous purchase... - # but I can't check that...) - if len(current): - current.remove_coins(action.fee) + # # remove transaction fees + # # (but only if it has a previous withdraw, or rather, if these are coins from a previous purchase... + # # but I can't check that...) + # if len(current): + # current.remove_coins(action.fee) - current.add(amount, price, action.date) + # current.add(amount, price, action.date) elif action.type == "withdrawal" and action.asset != "EUR": assert len(actions) == 1 - currency = action.asset - fifo_queues.setdefault(currency, FIFOQueue()) - amount = Decimal(action.amount) - price = 0 # Deposits typically have no associated cost basis - fifo_queues[currency].add(amount, price, action.date) + logger.error("Don't know how do handle withdrawals yet.") + # currency = action.asset + # fifo_queues.setdefault(currency, FIFOQueue()) + # amount = Decimal(action.amount) + # price = 0 # Deposits typically have no associated cost basis + # current = fifo_queues[currency] + + # current.add(amount, price, action.date) # Write report to CSV with open(output_path, "w", newline="") as csvfile: @@ -148,7 +152,7 @@ def process_ledger(read_actions: List[LedgerAction], output_path: str): # Usage -ledger_path = "kraken_ledger.csv" # Replace with your ledger file path +ledger_path = "ledgers.csv" # Replace with your ledger file path output_path = "tax_report.csv" # Replace with your desired output file path actions = read_ledger(ledger_path) process_ledger(actions, output_path) diff --git a/trade_queue.py b/trade_queue.py index 5cf31ae..8890ec2 100644 --- a/trade_queue.py +++ b/trade_queue.py @@ -6,7 +6,7 @@ from trade import Trade # Set up a dedicated logger for FIFOQueue logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) +logger.setLevel(logging.ERROR) class FIFOQueue: """ |