Create plugin to process Crypto.com App exported CSV - #290
Create plugin to process Crypto.com App exported CSV#290FrancoETrujillo wants to merge 2 commits into
Conversation
|
Since Crypto.com tax was deprecated. I created this plugin for my use case and wanted to share in case it is of value for the project. |
|
Thanks! Appreciate the contribution. We'll review it soon. |
eprbell
left a comment
There was a problem hiding this comment.
Looks good: just a few minor nits.
| @@ -0,0 +1,248 @@ | |||
| import math | |||
There was a problem hiding this comment.
Add the Copyright/Apache license header to this file.
| ) -> None: | ||
| super().__init__(account_holder=account_holder, native_fiat=native_fiat) | ||
| self.__in_csv_file: Optional[str] = in_csv_file | ||
| self.__logger: logging.Logger = create_logger(self.__CRYPTO_COM_APP) |
There was a problem hiding this comment.
Append account holder to log name.
| ): | ||
| self.raw_data = raw_data | ||
| self.timestamp = time | ||
| self.abs_float_amount = abs(float(amount)) |
There was a problem hiding this comment.
Use RP2Decimal instead of float throughout the file to avoid precision problems.
| assert result.asset == "CRO" | ||
| assert result.timestamp == "2022-03-31 00:03:00+0000" | ||
| assert result.transaction_type.lower() == Keyword.INCOME.value.lower() | ||
| assert math.isclose(float(result.crypto_in), float(transaction.amount), rel_tol=1e-9) |
There was a problem hiding this comment.
After switching to RP2Decimal, use is_equal_within_precision instead of isclose (seej https://github.com/eprbell/rp2/blob/main/src/rp2/out_transaction.py#L99). Same thing in the rest of the file.
0e41a43 to
eed7615
Compare
Plugin to process transactions exported from the Crypto.com app.
I did my best to map the transactions correctly, but could have misinterpreted any of them.