CSV import from Kraken

Hi all!

Im trying to find a way how to import ledger from Kraken to automate transactions import to PP.
Have anyone created a template to share or give ideas how to create one?

For example when staking crypto, I get “rewards” credited to my account (extra pieces of coins), as they are not dividend nor purchase, it is difficult to classify.

Im thinking maybe its simply easier to aggregate the month movements and enter whole amount manually once per month, but im not give up hope yet :slight_smile:

5 Likes

See CSV-Import von Kraken - #4 by alex90

Hi Alex90, I tried to use your script but as I have almost no experience with Python and PF, I don’t get how to use it.
I have my ledger data and historical crypto prices as .csv in the folder of the script.
And then I don’t get what I should do in order to process it.

Thank you for your help

Hi,

unfortunately there is no version yet that you can “just run”, at the moment you need to prepare the environment for the python script manually. That means you need to download python, then install pipenv and the project dependencies, and then run the script as shown in the example in the README.md. If I have some time in the coming weeks I will try to provide the whole thing as a one-file download, that just needs to be run from the commandline, if that helps. Until then you could try setting up python and running it yourself.

Hi alex90,
1 year later, I finally tried to use your script.
However, I get an error that I don’t know how to fix :

Traceback (most recent call last):
  File "C:\Users\Famille\Desktop\Kraken\PP-Crypto-Parser\cli.py", line 47, in <module>
    lp = LedgerProcessor(filename=args.kraken_csv_file,
                         rate_provider=rate_provider,
    ...<4 lines>...
                         account=args.account,
                         language=args.language)
  File "C:\Users\Famille\Desktop\Kraken\PP-Crypto-Parser\src\ledger_processor.py", line 54, in __init__
    self._process_transactions()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\Famille\Desktop\Kraken\PP-Crypto-Parser\src\ledger_processor.py", line 726, in _process_transactions
    new_account_transactions, new_depot_transactions = self._process_transaction(transaction_id, transaction)
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Famille\Desktop\Kraken\PP-Crypto-Parser\src\ledger_processor.py", line 669, in _process_transaction
    return self._process_staking(transaction_id, transaction)
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Famille\Desktop\Kraken\PP-Crypto-Parser\src\ledger_processor.py", line 613, in _process_staking
    value = round(amount * rate, 8)
                  ~~~~~~~^~~~~~
TypeError: can't multiply sequence by non-int of type 'float'

Thank you for your help

Dear BarbeRousse

It seems that maybe the format of the exported rates file (from PP) seems to be wrong - can you post one example line from this file?

You can also try the following:

  • Print or check types: Add a print statement before the line causing the error to confirm the types of amount and rate, like so:
print(f"amount: {amount} (type: {type(amount)}), rate: {rate} (type: {type(rate)})")
  • Convert to float: If either amount or rate is a string, you can convert it to a float with float(amount) or float(rate) before performing the multiplication.

Let me know if any of these fix the problem, then I can also fix it on GitHub :slight_smile: