dali-rp2


Namedali-rp2 JSON
Version 0.6.11 PyPI version JSON
download
home_pagehttps://github.com/eprbell/dali-rp2
SummaryData loader and input generator for RP2 (https://pypi.org/project/rp2/), the privacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, open-source and it prioritizes user privacy.
upload_time2024-07-25 02:29:58
maintainerNone
docs_urlNone
authoreprbell
requires_pythonNone
licenseApache License 2.0
keywords accounting altcoin bitcoin btc capital gains cost basis crypto cryptocurrency data loader defi eth ethereum exchange finance form 8949 nft privacy wallet tax
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--- Copyright 2022 eprbell --->

<!--- Licensed under the Apache License, Version 2.0 (the "License"); --->
<!--- you may not use this file except in compliance with the License. --->
<!--- You may obtain a copy of the License at --->

<!---     http://www.apache.org/licenses/LICENSE-2.0 --->

<!--- Unless required by applicable law or agreed to in writing, software --->
<!--- distributed under the License is distributed on an "AS IS" BASIS, --->
<!--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --->
<!--- See the License for the specific language governing permissions and --->
<!--- limitations under the License. --->

# DaLI for RP2 v0.6.11

Privacy-focused, free, extensible data loader for RP2 (the crypto tax calculator)

[![Static Analysis / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/static_analysis.yml)
[![Documentation Check / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/documentation_check.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/documentation_check.yml)
[![Unix Unit Tests / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/unix_unit_tests.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/unix_unit_tests.yml)
[![Windows Unit Tests / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/windows_unit_tests.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/windows_unit_tests.yml)
[![CodeQL/Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/codeql-analysis.yml)
<!-- markdown-link-check-disable -->
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=I%20use%20RP2,%20the%20privacy-focused,%20open%20source,%20free,%20non-commercial%20crypto%20tax%20calculator&url=https://github.com/eprbell/rp2/?anything)
<!-- markdown-link-check-enable -->
## Table of Contents
* **[Introduction](#introduction)**
* **[License](#license)**
* **[Download](#download)**
* **[Installation](#installation)**
  * [Ubuntu Linux](#installation-on-ubuntu-linux)
  * [macOS](#installation-on-macos)
  * [Windows 10](#installation-on-windows-10)
  * [Other Unix-like Systems](#installation-on-other-unix-like-systems)
* **[Running](#running)**
  * [Linux, macOS, Windows 10 and Other Unix-like Systems](#running-on-linux-macos-windows-10-and-other-unix-like-systems)
  * [Windows 10](#running-on-windows-10)
* **[Configuration File](#configuration-file)**
* **[Reporting Bugs](#reporting-bugs)**
* **[Contributing](#contributing)**
* **[Developer Documentation](#developer-documentation)**
* **[Frequently Asked Questions](#frequently-asked-questions)**
* **[Change Log](#change-log)**

## Introduction
[DaLI](https://github.com/eprbell/dali-rp2) (Data Loader Interface) is a data loader and input generator for [RP2](https://github.com/eprbell/rp2), the privacy-focused, free, non-commercial, open-source, community-driven multi-country cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, non-commercial, open-source and it prioritizes user privacy by storing crypto transaction data on the user's computer and never sending it anywhere else.

It performs the following operations:
* it reads in crypto transaction information from multiples native sources: CSV files and/or REST-based services;
* it analyzes, processes and merges this data;
* it uses the processed data to generate an ODS input file for RP2 and its respective configuration file.

DaLI has a programmable plugin architecture for [data loaders](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#data-loader-plugin-development) (both CSV and REST-based), [pair converters](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#pair-converter-plugin-development) and [countries](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#country-plugin-development). While some exchanges and wallets are already supported out-of-the-box, more are needed: help us make DaLI a robust open-source, community-driven crypto data loader by [contributing](https://github.com/eprbell/dali-rp2/tree/main/CONTRIBUTING.md#contributing-to-the-repository) plugins for exchanges and wallets! Check [open issues](https://github.com/eprbell/dali-rp2/issues) or open a new one.

DaLI has [unit test](https://github.com/eprbell/dali-rp2/tree/main/tests/) coverage to reduce the risk of regression.

Note that DaLI has RP2 as a dependency, so installing DaLI causes RP2 to be installed as well.

**IMPORTANT DISCLAIMER**:
* DaLI offers no guarantee of correctness (read the [license](https://github.com/eprbell/dali-rp2/tree/main/LICENSE)): always verify results with the help of a tax professional.
* The author of DaLI and RP2 is not a tax professional, but has used RP2 and DaLI personally for a few years.

## License
DaLI is released under the terms of Apache License Version 2.0. For more information see [LICENSE](https://github.com/eprbell/dali-rp2/tree/main/LICENSE) or <http://www.apache.org/licenses/LICENSE-2.0>.

## Download
The latest version of DaLI can be downloaded at: <https://pypi.org/project/dali-rp2/>

## Installation
DaLI has been tested on Ubuntu Linux, macOS and Windows 10 but it should work on all systems that have Python version 3.8.0 or greater.

### Installation on Ubuntu Linux
Open a terminal window and enter the following commands:

```console
sudo apt-get update
sudo apt-get install python3 python3-pip
```

Then install DaLI:

```console
pip install dali-rp2
```

### Installation on macOS
First make sure [Homebrew](https://brew.sh) is installed, then open a terminal window and enter the following commands:

```console
brew update
brew install python3
```

Then install DaLI:

```console
pip install dali-rp2
```

### Installation on Windows 10
First make sure [Python](https://python.org) 3.8 or greater is installed (in the Python installer window be sure to click on "Add Python to PATH").

Then make sure [Microsoft Visual C++](https://visualstudio.microsoft.com/visual-cpp-build-tools/) 14.0 or greater is installed (in the Visual Studio Installer window be sure to click on "Desktop development with C++"), which is needed for multidict.

Then open a PowerShell window and enter the following to install DaLI:

```console
pip install dali-rp2
```

### Installation on Other Unix-like Systems
* install python 3.8 or greater
* install pip3

Then install DaLI:

```console
pip install dali-rp2
```

## Running
DaLI reads in a user-prepared configuration file in [INI format](https://en.wikipedia.org/wiki/INI_file), which is used to initialize data loaders and configure DaLI's behavior. The format of the configuration file is described in detail in the [configuration file](https://github.com/eprbell/dali-rp2/tree/main/docs/configuration_file.md) documentation.

An example of a configuration file can be found in [test_config.ini](https://github.com/eprbell/dali-rp2/tree/main/config/test_config.ini).

After processing the configuration file, DaLI reads crypto data from native sources and generates a RP2 input ODS file and a RP2 configuration file in the `output` directory or where specified with the `-o` CLI option.

The DaLI executable is country-dependent: `dali_<country_code>`, where country code is a [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), 2-letter identifier (e.g. `dali_us`, `dali_jp`, etc).

Provided [DaLI is installed](#installation), to generate RP2 input files from the example configuration, open a terminal window (or PowerShell if on Windows).

Create the directory structure and download the example input files using wget or manually.

```console
mkdir -p input
```

If your system has wget:

```console
wget https://raw.githubusercontent.com/eprbell/dali-rp2/main/config/test_config.ini
wget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_manual_in.csv -P input/
wget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_manual_intra.csv -P input/
wget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_trezor_alice_btc.csv -P input/
wget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_trezor_bob_btc.csv -P input/
```

If your system doesn't have wget, download the following files manually:
* [test_config.ini](https://github.com/eprbell/dali-rp2/tree/main/config/test_config.ini)
* [test_manual_in.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_manual_in.csv)
* [test_manual_intra.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_manual_intra.csv)
* [test_trezor_alice.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_trezor_alice_btc.csv)
* [test_trezor_bob.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_trezor_bob_btc.csv)

And move the csv files to the input directory:
```console
mv *.csv input
```

Then generate the US output files for rp2:
```console
dali_us -s -o output -p test_ test_config.ini
 ```

* `-s` option allows DaLI to retrieve spot price information from the Internet, when it's not available from the CSV files or REST endpoints.
* `-o` option specifies the directory where the ODS output file is generated.
* `-p` is the prefix of the output file.
* `test_config.ini` is the configuration that ties the inputs together.

To print command usage information for the `dali_us` command:

```console
dali_us --help
```

Finally compute taxes with RP2 using the generated input files (using both FIFO and LIFO accounting methods):

```console
rp2_us -m fifo -o output/ -p rp2_ output/test_crypto_data.ini output/test_crypto_data.ods
rp2_us -m lifo -o output/ -p rp2_ output/test_crypto_data.ini output/test_crypto_data.ods
```

## Configuration File
Read the [configuration file](https://github.com/eprbell/dali-rp2/tree/main/docs/configuration_file.md) documentation.

## Reporting Bugs
Read the [Contributing](https://github.com/eprbell/dali-rp2/tree/main/CONTRIBUTING.md#reporting-bugs) document.

## Contributing
Read the [Contributing](https://github.com/eprbell/dali-rp2/tree/main/CONTRIBUTING.md) document.

## Developer Documentation
Read the [developer documentation](https://github.com/eprbell/dali-rp2/tree/main/README.dev.md).

## Frequently Asked Questions
Read the [user FAQ list](https://github.com/eprbell/dali-rp2/tree/main/docs/user_faq.md) and the [developer FAQ list](https://github.com/eprbell/dali-rp2/tree/main/docs/developer_faq.md).

## Change Log
Read the [Change Log](https://github.com/eprbell/dali-rp2/tree/main/CHANGELOG.md) document.

<!--- Copyright 2022 eprbell --->

<!--- Licensed under the Apache License, Version 2.0 (the "License"); --->
<!--- you may not use this file except in compliance with the License. --->
<!--- You may obtain a copy of the License at --->

<!---     http://www.apache.org/licenses/LICENSE-2.0 --->

<!--- Unless required by applicable law or agreed to in writing, software --->
<!--- distributed under the License is distributed on an "AS IS" BASIS, --->
<!--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --->
<!--- See the License for the specific language governing permissions and --->
<!--- limitations under the License. --->

# RP2 Change Log

## 0.6.11
* Add support for generic country
* Add support for Ireland
* Enable optional use of CSV files for Forex pricing instead of relying on exchangerate.host (#225)

## 0.6.10
* Add support for Spain (#187)
* Added Kraken REST plugin (#114)
* Kraken pair converter can now handle the new unified CSV format (#223)
* Fixed pricing bug when using default exchange (#207)
* Added access keys for Exchangerates.host (#212)
* Added Binance dividends (#188) and fiat data pull (#186)
* Added progress bar when resolving transactions (#153)
* misc bug fixes (#146, #198, #207, etc.) and internal features (#171, #196, #213, #215, etc.)

## 0.6.9
* new Dijkstra-based pair converter implementation (#142)
* added Coinbase Pro-based CCXT pair converter (#150)
* fixed a bug in cache setup of CCXT pair converters (#149)
* fixed a bug in Bitbank fee-only transactions (#155)
* fixed spreadsheet size, which was set to a large value regardless of how many rows it contained (#147)
* added XYMUSDT alternative market to CCXT pair converter (#158)
* various optimizations (#151, #152))
* various documentation fixes (#144, #148)

## 0.6.8
* Coinbase data loader: added a new flavor of transfer transaction that was slightly different from the other ones (#137)

## 0.6.7
* Coinbase data loader: fixed bug in advanced trade buy logic was not accounting for fee correctly
* Coinbase data loader: added support for moving coins into staking pool (#132)

## 0.6.5
* new Trezor CSV plugin supporting the latest format from Trezor Suite

## 0.6.4
* added new RP2 Input data loader plugin, which can read RP2 input format data back into DaLI
* improvements to Kraken CSV pair converter plugin: price data files are now downloaded locally and chunked to avoid excessive memory use
* improvements to Coinbase plugin: added support for advanced_trade_fill, cardspend and cardbuyback
* various smaller fixes and improvements

## 0.6.3
* added CCXT pair converter subclasses that are fixed to one exchange (Kraken, Binance)
* added fiat deposit support to Bitbank plugin
* small fixes and improvements

## 0.6.2
* added Kraken CSV price importer
* various fixes to CCXT-based plugins
* small improvements to some CSV data loaders
* updated documentation

## 0.6.1
* added CCXT-based abstract superclass for REST data loader plugins (#80): this makes it much easier to add a new REST-based data loader
* added Bitbank REST input plugin and CSV supplemental input plugin
* added Coincheck CSV supplemental input plugin
* updated RP2 to 1.3.1
* updated documentation

## 0.6.0
* As of RP2 1.3.0, RP2 configuration files are no longer expressed in JSON format: they now use the INI format. So DaLI has been updated to generates INI-format configuration files instead of JSON. Any old JSON-format configuration file can be converted to the new INI format with the following command: rp2_config <json_config>
* added Pionex CSV data loader plugin

## 0.5.2
* added Binance.com REST data loader plugin
* added Binance.com supplemental (CSV) data loader plugin (for autoinvest purchases and ETH to BETH conversions)
* added CCXT-based pair converter
* updated documentation

## 0.5.1
* updated RP2 dependency to latest version, which fixes 2 bugs in HIFO. If you're using HIFO be sure to use RP2 1.10 or better.
* tweaked documentation

## 0.5.0
* add top-level multi-thread support: it's now possible to run data loader plugins in parallel, using the -t option (which selects the number of parallel threads)
* added Nexo CSV input plugin
* Coinbase REST input plugin: added support for Coinbase Earn Reversals (due to CC refunds, etc.)
* BlockFI CSV input plugin: added new transaction types
* revised and improved all documentation
* added FAQs

## 0.4.12
* added country plugin infrastructure (US is the default country plugin). Default fiat is no longer hardcoded to USD (it now comes from the country plugin)
* updated generators and rest of the code to use the native fiat from the country plugin (previously it was hard coded as USD)
* the dali script has been renamed to dali_us to support the new country plugin architecture
* added exchange hint to pair converter API
* added Ledger CSV data loader
* added credit card spend transactions to Coinbase plugin
* renamed cache folder from .cache to .dali_cache
* updated documentation to reflect latest changes
* small additions and fixes to documentation and code

## 0.4.9
* added new pair conversion plugin infrastructure
* added support for currency conversion to transaction resolver (useful to support non-USD fiats from foreign exchanges)
* fixed PR #44: added configurable historical data behavior and improved caching
* small improvements to code and documentation

## 0.4.8
* fixed PR #35: added exchange_withdrawal transaction type to Coinbase plugin
* various documentation improvements
* updated RP2 dependency to 1.0.0

## 0.4.7
* fixed issue #34: sometimes Coinbase returns bad fiat data for crypto conversions (fiat amount of sale < fiat amount of buy). DaLI used to raise an exception: now it issues a warning and sets the fiat fee to 0
* Coinbase plugin: _process_transfer() refactoring

## 0.4.6
* fixed PRs #31 and #36: various improvements to the logic that reads prices from Web

## 0.4.5
* Coinbase Pro: fixed a bug which caused the total fiat value (including fee) to be incorrect for certain crypto conversions
* added developer FAQ

## 0.4.4
* fixed a regression introduced recently: in certain cases, some fees related to conversions would no longer be generated (thus causing small deductions to be ignored)
* added support for USDC: previously it was conflated into fiat and didn't generate a tab, now it does
* Coinbase plugin: added support for fiat_withdrawal and fiat_deposit transactions. They are now tracked internally and no longer cause an unsupported transaction warning
* Coinbase Pro plugin: added support for "conversion" native transactions (these seem to occur when CBPro converts from/to a stable coin)
* minor changes to documentation

## 0.4.3
* rewrote Coinbase coin swap logic: it now handles correctly swaps from stable coins with a fee (previously it would ignore the fee)
* various documentation fixes and some refactoring

## 0.4.2
* fixed issue #21: fee-typed out-transactions in the manual plugin would cause an exception
* reviewed all documentation

## 0.4.1
* minor documentation fixes

## 0.4.0
* fixed issue #20: Coinbase plugin now supports the staking_reward transaction type
* fix for Coinbase reporting fiat with low precision (only 2 decimal digits): if the value is less than 1c Coinbase rounds it to zero, which caused various computation problems (spot_price, etc.). As a workaround, when this condition is detected the plugin sets affected fields to UNKNOWN or None (depending on their nature), so that they can be filled later by the transaction resolver and RP2

## 0.3.28
* added threading support to Coinbase Pro
* thread count can now be specified in the plugin configuration section of the .ini file
* additional fix in missing fiat_fee issue in crypto swaps on Coinbase (issue #15)
* updated documentation

## 0.3.27
* fix for missing fiat_fee issue in crypto swaps on Coinbase (issue #15)

## 0.3.26
* -s CLI option to read missing spot prices from Web: rewrote implementation from Yahoo Finance (daily granularity) to Coinbase Pro (minute granularity)
* moved cache logic to its own module, so it can be used in multiple places: plugins, transaction_resolver, etc.
* fixed issue #19: the user needs to pass -s to read highly granular price data from Coinbase Pro, when it's missing (or computed as 0)

## 0.3.25
* merged PR #18: Coinbase plugin wasn't handling crypto conversions correctly and generated negative amounts.

## 0.3.23
* merged PR #14: in Coinbase Pro plugin crypto fee is now modeled correctly both for buy and sell-side fills
* fixed issue #16: added support for inflation_reward transaction in Coinbase plugin
* added load caching to speed up development (PR #12)
* added parallelism to Coinbase plugin (PR #12)

## 0.3.22
* fixed issue #16: added support for Coinbase inflation reward transaction
* added error log for unknown transaction type in all plugins, so they are easy to identify and report
* added FAQ on supported exchanges/wallets
* added support for more transaction types in BlockFi plugin (PR #11)

## 0.3.21
* fixed bug reported in issue https://github.com/eprbell/dali-rp2/issues/10
* fixed from/to_currency detection in Coinbase Pro plugin (PR #9)
* added initial version of developer FAQ document: https://github.com/eprbell/dali-rp2/blob/main/docs/developer_faq.md
* minor fixes to documentation

## 0.3.20
* fixed a bug in transaction resolver: IN -> IN transaction hint was assigning wrong value to fiat_fee
* fixed a bug in Coinbase plugin: receiving a crypto gift from another Coinbase user generated a transaction with wrong fiat_in_with_fee value
* reworked some of the code to use latest RP2 features: specifically fee-only transactions and crypto_fee in in-transactions. E.g.: Coinbase Pro coin swap code, transaction resolver INTRA -> OUT transaction hint application, etc.
* DaLI output file (the RP2 input file) now has in-transaction crypto_fee. Also updated unit test golden file
* refactored all transaction constructor calls to use keyword arg calling style
* updated setup.cfg dependencies to latest RP2

## 0.3.19
* Trezor plugin: AM/PM was not parsed correctly in timestamp. Fixed.
* Minor fixes

## 0.3.18
* fixed a limitation in timestamp processing in Trezor and Trezor Old plugins. The timezone that was passed to the plugin constructor could only be an ISO 8601 format offset: something like "America/Los Angeles" would not be accepted. This caused problems with daylight saving timestamps in Trezor CSV files: daylight savings time would just be ignored, thus causing Trezor summer timestamps to be 1 hour off
* updated input, input/golden, config and docs/configuration_file.md to reflect the above fix
* added pytz stubs

## v0.3.17
* added new FAQ on adding support for new wallets and exchanges
* minor fixes

## v0.3.16
* Trezor plugin: dusting attack was incorrectly interpreted as cost-only transaction. Now it issues a warning to the user
* minor fixes to documentation

## v0.3.15
* minor edits to documentation and metafiles

## v0.3.12
* fixed a few broken links in README.md (when used from Pypi only)
* fixed CLI --help description
* minor improvements to documentation

## v0.3.7
* major improvements to documentation
* added notes in generated file to describe crypto conversion transactions in Coinbase Pro
* small performance improvement: signature reflexive call is now called only once per class, instead of once per instance

## v0.3.6
* template.ods was missing from the final package. Fixed in setup.cfg
* various fixes to documentation

## v0.3.4
* First version tracked in change log and uploaded to Github

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eprbell/dali-rp2",
    "name": "dali-rp2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "accounting, altcoin, bitcoin, BTC, capital gains, cost basis, crypto, cryptocurrency, data loader, DeFi, ETH, ethereum, exchange, finance, form 8949, NFT, privacy, wallet, tax",
    "author": "eprbell",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/db/af/4fce962c527b0ac9c9d8e57c5441fe5ca9ae89a8f4e0684ba3371118ca30/dali_rp2-0.6.11.tar.gz",
    "platform": null,
    "description": "<!--- Copyright 2022 eprbell --->\n\n<!--- Licensed under the Apache License, Version 2.0 (the \"License\"); --->\n<!--- you may not use this file except in compliance with the License. --->\n<!--- You may obtain a copy of the License at --->\n\n<!---     http://www.apache.org/licenses/LICENSE-2.0 --->\n\n<!--- Unless required by applicable law or agreed to in writing, software --->\n<!--- distributed under the License is distributed on an \"AS IS\" BASIS, --->\n<!--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --->\n<!--- See the License for the specific language governing permissions and --->\n<!--- limitations under the License. --->\n\n# DaLI for RP2 v0.6.11\n\nPrivacy-focused, free, extensible data loader for RP2 (the crypto tax calculator)\n\n[![Static Analysis / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/static_analysis.yml)\n[![Documentation Check / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/documentation_check.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/documentation_check.yml)\n[![Unix Unit Tests / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/unix_unit_tests.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/unix_unit_tests.yml)\n[![Windows Unit Tests / Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/windows_unit_tests.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/windows_unit_tests.yml)\n[![CodeQL/Main Branch](https://github.com/eprbell/dali-rp2/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/eprbell/dali-rp2/actions/workflows/codeql-analysis.yml)\n<!-- markdown-link-check-disable -->\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=I%20use%20RP2,%20the%20privacy-focused,%20open%20source,%20free,%20non-commercial%20crypto%20tax%20calculator&url=https://github.com/eprbell/rp2/?anything)\n<!-- markdown-link-check-enable -->\n## Table of Contents\n* **[Introduction](#introduction)**\n* **[License](#license)**\n* **[Download](#download)**\n* **[Installation](#installation)**\n  * [Ubuntu Linux](#installation-on-ubuntu-linux)\n  * [macOS](#installation-on-macos)\n  * [Windows 10](#installation-on-windows-10)\n  * [Other Unix-like Systems](#installation-on-other-unix-like-systems)\n* **[Running](#running)**\n  * [Linux, macOS, Windows 10 and Other Unix-like Systems](#running-on-linux-macos-windows-10-and-other-unix-like-systems)\n  * [Windows 10](#running-on-windows-10)\n* **[Configuration File](#configuration-file)**\n* **[Reporting Bugs](#reporting-bugs)**\n* **[Contributing](#contributing)**\n* **[Developer Documentation](#developer-documentation)**\n* **[Frequently Asked Questions](#frequently-asked-questions)**\n* **[Change Log](#change-log)**\n\n## Introduction\n[DaLI](https://github.com/eprbell/dali-rp2) (Data Loader Interface) is a data loader and input generator for [RP2](https://github.com/eprbell/rp2), the privacy-focused, free, non-commercial, open-source, community-driven multi-country cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, non-commercial, open-source and it prioritizes user privacy by storing crypto transaction data on the user's computer and never sending it anywhere else.\n\nIt performs the following operations:\n* it reads in crypto transaction information from multiples native sources: CSV files and/or REST-based services;\n* it analyzes, processes and merges this data;\n* it uses the processed data to generate an ODS input file for RP2 and its respective configuration file.\n\nDaLI has a programmable plugin architecture for [data loaders](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#data-loader-plugin-development) (both CSV and REST-based), [pair converters](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#pair-converter-plugin-development) and [countries](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#country-plugin-development). While some exchanges and wallets are already supported out-of-the-box, more are needed: help us make DaLI a robust open-source, community-driven crypto data loader by [contributing](https://github.com/eprbell/dali-rp2/tree/main/CONTRIBUTING.md#contributing-to-the-repository) plugins for exchanges and wallets! Check [open issues](https://github.com/eprbell/dali-rp2/issues) or open a new one.\n\nDaLI has [unit test](https://github.com/eprbell/dali-rp2/tree/main/tests/) coverage to reduce the risk of regression.\n\nNote that DaLI has RP2 as a dependency, so installing DaLI causes RP2 to be installed as well.\n\n**IMPORTANT DISCLAIMER**:\n* DaLI offers no guarantee of correctness (read the [license](https://github.com/eprbell/dali-rp2/tree/main/LICENSE)): always verify results with the help of a tax professional.\n* The author of DaLI and RP2 is not a tax professional, but has used RP2 and DaLI personally for a few years.\n\n## License\nDaLI is released under the terms of Apache License Version 2.0. For more information see [LICENSE](https://github.com/eprbell/dali-rp2/tree/main/LICENSE) or <http://www.apache.org/licenses/LICENSE-2.0>.\n\n## Download\nThe latest version of DaLI can be downloaded at: <https://pypi.org/project/dali-rp2/>\n\n## Installation\nDaLI has been tested on Ubuntu Linux, macOS and Windows 10 but it should work on all systems that have Python version 3.8.0 or greater.\n\n### Installation on Ubuntu Linux\nOpen a terminal window and enter the following commands:\n\n```console\nsudo apt-get update\nsudo apt-get install python3 python3-pip\n```\n\nThen install DaLI:\n\n```console\npip install dali-rp2\n```\n\n### Installation on macOS\nFirst make sure [Homebrew](https://brew.sh) is installed, then open a terminal window and enter the following commands:\n\n```console\nbrew update\nbrew install python3\n```\n\nThen install DaLI:\n\n```console\npip install dali-rp2\n```\n\n### Installation on Windows 10\nFirst make sure [Python](https://python.org) 3.8 or greater is installed (in the Python installer window be sure to click on \"Add Python to PATH\").\n\nThen make sure [Microsoft Visual C++](https://visualstudio.microsoft.com/visual-cpp-build-tools/) 14.0 or greater is installed (in the Visual Studio Installer window be sure to click on \"Desktop development with C++\"), which is needed for multidict.\n\nThen open a PowerShell window and enter the following to install DaLI:\n\n```console\npip install dali-rp2\n```\n\n### Installation on Other Unix-like Systems\n* install python 3.8 or greater\n* install pip3\n\nThen install DaLI:\n\n```console\npip install dali-rp2\n```\n\n## Running\nDaLI reads in a user-prepared configuration file in [INI format](https://en.wikipedia.org/wiki/INI_file), which is used to initialize data loaders and configure DaLI's behavior. The format of the configuration file is described in detail in the [configuration file](https://github.com/eprbell/dali-rp2/tree/main/docs/configuration_file.md) documentation.\n\nAn example of a configuration file can be found in [test_config.ini](https://github.com/eprbell/dali-rp2/tree/main/config/test_config.ini).\n\nAfter processing the configuration file, DaLI reads crypto data from native sources and generates a RP2 input ODS file and a RP2 configuration file in the `output` directory or where specified with the `-o` CLI option.\n\nThe DaLI executable is country-dependent: `dali_<country_code>`, where country code is a [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), 2-letter identifier (e.g. `dali_us`, `dali_jp`, etc).\n\nProvided [DaLI is installed](#installation), to generate RP2 input files from the example configuration, open a terminal window (or PowerShell if on Windows).\n\nCreate the directory structure and download the example input files using wget or manually.\n\n```console\nmkdir -p input\n```\n\nIf your system has wget:\n\n```console\nwget https://raw.githubusercontent.com/eprbell/dali-rp2/main/config/test_config.ini\nwget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_manual_in.csv -P input/\nwget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_manual_intra.csv -P input/\nwget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_trezor_alice_btc.csv -P input/\nwget https://raw.githubusercontent.com/eprbell/dali-rp2/main/input/test_trezor_bob_btc.csv -P input/\n```\n\nIf your system doesn't have wget, download the following files manually:\n* [test_config.ini](https://github.com/eprbell/dali-rp2/tree/main/config/test_config.ini)\n* [test_manual_in.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_manual_in.csv)\n* [test_manual_intra.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_manual_intra.csv)\n* [test_trezor_alice.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_trezor_alice_btc.csv)\n* [test_trezor_bob.csv](https://github.com/eprbell/dali-rp2/tree/main/input/test_trezor_bob_btc.csv)\n\nAnd move the csv files to the input directory:\n```console\nmv *.csv input\n```\n\nThen generate the US output files for rp2:\n```console\ndali_us -s -o output -p test_ test_config.ini\n ```\n\n* `-s` option allows DaLI to retrieve spot price information from the Internet, when it's not available from the CSV files or REST endpoints.\n* `-o` option specifies the directory where the ODS output file is generated.\n* `-p` is the prefix of the output file.\n* `test_config.ini` is the configuration that ties the inputs together.\n\nTo print command usage information for the `dali_us` command:\n\n```console\ndali_us --help\n```\n\nFinally compute taxes with RP2 using the generated input files (using both FIFO and LIFO accounting methods):\n\n```console\nrp2_us -m fifo -o output/ -p rp2_ output/test_crypto_data.ini output/test_crypto_data.ods\nrp2_us -m lifo -o output/ -p rp2_ output/test_crypto_data.ini output/test_crypto_data.ods\n```\n\n## Configuration File\nRead the [configuration file](https://github.com/eprbell/dali-rp2/tree/main/docs/configuration_file.md) documentation.\n\n## Reporting Bugs\nRead the [Contributing](https://github.com/eprbell/dali-rp2/tree/main/CONTRIBUTING.md#reporting-bugs) document.\n\n## Contributing\nRead the [Contributing](https://github.com/eprbell/dali-rp2/tree/main/CONTRIBUTING.md) document.\n\n## Developer Documentation\nRead the [developer documentation](https://github.com/eprbell/dali-rp2/tree/main/README.dev.md).\n\n## Frequently Asked Questions\nRead the [user FAQ list](https://github.com/eprbell/dali-rp2/tree/main/docs/user_faq.md) and the [developer FAQ list](https://github.com/eprbell/dali-rp2/tree/main/docs/developer_faq.md).\n\n## Change Log\nRead the [Change Log](https://github.com/eprbell/dali-rp2/tree/main/CHANGELOG.md) document.\n\n<!--- Copyright 2022 eprbell --->\n\n<!--- Licensed under the Apache License, Version 2.0 (the \"License\"); --->\n<!--- you may not use this file except in compliance with the License. --->\n<!--- You may obtain a copy of the License at --->\n\n<!---     http://www.apache.org/licenses/LICENSE-2.0 --->\n\n<!--- Unless required by applicable law or agreed to in writing, software --->\n<!--- distributed under the License is distributed on an \"AS IS\" BASIS, --->\n<!--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --->\n<!--- See the License for the specific language governing permissions and --->\n<!--- limitations under the License. --->\n\n# RP2 Change Log\n\n## 0.6.11\n* Add support for generic country\n* Add support for Ireland\n* Enable optional use of CSV files for Forex pricing instead of relying on exchangerate.host (#225)\n\n## 0.6.10\n* Add support for Spain (#187)\n* Added Kraken REST plugin (#114)\n* Kraken pair converter can now handle the new unified CSV format (#223)\n* Fixed pricing bug when using default exchange (#207)\n* Added access keys for Exchangerates.host (#212)\n* Added Binance dividends (#188) and fiat data pull (#186)\n* Added progress bar when resolving transactions (#153)\n* misc bug fixes (#146, #198, #207, etc.) and internal features (#171, #196, #213, #215, etc.)\n\n## 0.6.9\n* new Dijkstra-based pair converter implementation (#142)\n* added Coinbase Pro-based CCXT pair converter (#150)\n* fixed a bug in cache setup of CCXT pair converters (#149)\n* fixed a bug in Bitbank fee-only transactions (#155)\n* fixed spreadsheet size, which was set to a large value regardless of how many rows it contained (#147)\n* added XYMUSDT alternative market to CCXT pair converter (#158)\n* various optimizations (#151, #152))\n* various documentation fixes (#144, #148)\n\n## 0.6.8\n* Coinbase data loader: added a new flavor of transfer transaction that was slightly different from the other ones (#137)\n\n## 0.6.7\n* Coinbase data loader: fixed bug in advanced trade buy logic was not accounting for fee correctly\n* Coinbase data loader: added support for moving coins into staking pool (#132)\n\n## 0.6.5\n* new Trezor CSV plugin supporting the latest format from Trezor Suite\n\n## 0.6.4\n* added new RP2 Input data loader plugin, which can read RP2 input format data back into DaLI\n* improvements to Kraken CSV pair converter plugin: price data files are now downloaded locally and chunked to avoid excessive memory use\n* improvements to Coinbase plugin: added support for advanced_trade_fill, cardspend and cardbuyback\n* various smaller fixes and improvements\n\n## 0.6.3\n* added CCXT pair converter subclasses that are fixed to one exchange (Kraken, Binance)\n* added fiat deposit support to Bitbank plugin\n* small fixes and improvements\n\n## 0.6.2\n* added Kraken CSV price importer\n* various fixes to CCXT-based plugins\n* small improvements to some CSV data loaders\n* updated documentation\n\n## 0.6.1\n* added CCXT-based abstract superclass for REST data loader plugins (#80): this makes it much easier to add a new REST-based data loader\n* added Bitbank REST input plugin and CSV supplemental input plugin\n* added Coincheck CSV supplemental input plugin\n* updated RP2 to 1.3.1\n* updated documentation\n\n## 0.6.0\n* As of RP2 1.3.0, RP2 configuration files are no longer expressed in JSON format: they now use the INI format. So DaLI has been updated to generates INI-format configuration files instead of JSON. Any old JSON-format configuration file can be converted to the new INI format with the following command: rp2_config <json_config>\n* added Pionex CSV data loader plugin\n\n## 0.5.2\n* added Binance.com REST data loader plugin\n* added Binance.com supplemental (CSV) data loader plugin (for autoinvest purchases and ETH to BETH conversions)\n* added CCXT-based pair converter\n* updated documentation\n\n## 0.5.1\n* updated RP2 dependency to latest version, which fixes 2 bugs in HIFO. If you're using HIFO be sure to use RP2 1.10 or better.\n* tweaked documentation\n\n## 0.5.0\n* add top-level multi-thread support: it's now possible to run data loader plugins in parallel, using the -t option (which selects the number of parallel threads)\n* added Nexo CSV input plugin\n* Coinbase REST input plugin: added support for Coinbase Earn Reversals (due to CC refunds, etc.)\n* BlockFI CSV input plugin: added new transaction types\n* revised and improved all documentation\n* added FAQs\n\n## 0.4.12\n* added country plugin infrastructure (US is the default country plugin). Default fiat is no longer hardcoded to USD (it now comes from the country plugin)\n* updated generators and rest of the code to use the native fiat from the country plugin (previously it was hard coded as USD)\n* the dali script has been renamed to dali_us to support the new country plugin architecture\n* added exchange hint to pair converter API\n* added Ledger CSV data loader\n* added credit card spend transactions to Coinbase plugin\n* renamed cache folder from .cache to .dali_cache\n* updated documentation to reflect latest changes\n* small additions and fixes to documentation and code\n\n## 0.4.9\n* added new pair conversion plugin infrastructure\n* added support for currency conversion to transaction resolver (useful to support non-USD fiats from foreign exchanges)\n* fixed PR #44: added configurable historical data behavior and improved caching\n* small improvements to code and documentation\n\n## 0.4.8\n* fixed PR #35: added exchange_withdrawal transaction type to Coinbase plugin\n* various documentation improvements\n* updated RP2 dependency to 1.0.0\n\n## 0.4.7\n* fixed issue #34: sometimes Coinbase returns bad fiat data for crypto conversions (fiat amount of sale < fiat amount of buy). DaLI used to raise an exception: now it issues a warning and sets the fiat fee to 0\n* Coinbase plugin: _process_transfer() refactoring\n\n## 0.4.6\n* fixed PRs #31 and #36: various improvements to the logic that reads prices from Web\n\n## 0.4.5\n* Coinbase Pro: fixed a bug which caused the total fiat value (including fee) to be incorrect for certain crypto conversions\n* added developer FAQ\n\n## 0.4.4\n* fixed a regression introduced recently: in certain cases, some fees related to conversions would no longer be generated (thus causing small deductions to be ignored)\n* added support for USDC: previously it was conflated into fiat and didn't generate a tab, now it does\n* Coinbase plugin: added support for fiat_withdrawal and fiat_deposit transactions. They are now tracked internally and no longer cause an unsupported transaction warning\n* Coinbase Pro plugin: added support for \"conversion\" native transactions (these seem to occur when CBPro converts from/to a stable coin)\n* minor changes to documentation\n\n## 0.4.3\n* rewrote Coinbase coin swap logic: it now handles correctly swaps from stable coins with a fee (previously it would ignore the fee)\n* various documentation fixes and some refactoring\n\n## 0.4.2\n* fixed issue #21: fee-typed out-transactions in the manual plugin would cause an exception\n* reviewed all documentation\n\n## 0.4.1\n* minor documentation fixes\n\n## 0.4.0\n* fixed issue #20: Coinbase plugin now supports the staking_reward transaction type\n* fix for Coinbase reporting fiat with low precision (only 2 decimal digits): if the value is less than 1c Coinbase rounds it to zero, which caused various computation problems (spot_price, etc.). As a workaround, when this condition is detected the plugin sets affected fields to UNKNOWN or None (depending on their nature), so that they can be filled later by the transaction resolver and RP2\n\n## 0.3.28\n* added threading support to Coinbase Pro\n* thread count can now be specified in the plugin configuration section of the .ini file\n* additional fix in missing fiat_fee issue in crypto swaps on Coinbase (issue #15)\n* updated documentation\n\n## 0.3.27\n* fix for missing fiat_fee issue in crypto swaps on Coinbase (issue #15)\n\n## 0.3.26\n* -s CLI option to read missing spot prices from Web: rewrote implementation from Yahoo Finance (daily granularity) to Coinbase Pro (minute granularity)\n* moved cache logic to its own module, so it can be used in multiple places: plugins, transaction_resolver, etc.\n* fixed issue #19: the user needs to pass -s to read highly granular price data from Coinbase Pro, when it's missing (or computed as 0)\n\n## 0.3.25\n* merged PR #18: Coinbase plugin wasn't handling crypto conversions correctly and generated negative amounts.\n\n## 0.3.23\n* merged PR #14: in Coinbase Pro plugin crypto fee is now modeled correctly both for buy and sell-side fills\n* fixed issue #16: added support for inflation_reward transaction in Coinbase plugin\n* added load caching to speed up development (PR #12)\n* added parallelism to Coinbase plugin (PR #12)\n\n## 0.3.22\n* fixed issue #16: added support for Coinbase inflation reward transaction\n* added error log for unknown transaction type in all plugins, so they are easy to identify and report\n* added FAQ on supported exchanges/wallets\n* added support for more transaction types in BlockFi plugin (PR #11)\n\n## 0.3.21\n* fixed bug reported in issue https://github.com/eprbell/dali-rp2/issues/10\n* fixed from/to_currency detection in Coinbase Pro plugin (PR #9)\n* added initial version of developer FAQ document: https://github.com/eprbell/dali-rp2/blob/main/docs/developer_faq.md\n* minor fixes to documentation\n\n## 0.3.20\n* fixed a bug in transaction resolver: IN -> IN transaction hint was assigning wrong value to fiat_fee\n* fixed a bug in Coinbase plugin: receiving a crypto gift from another Coinbase user generated a transaction with wrong fiat_in_with_fee value\n* reworked some of the code to use latest RP2 features: specifically fee-only transactions and crypto_fee in in-transactions. E.g.: Coinbase Pro coin swap code, transaction resolver INTRA -> OUT transaction hint application, etc.\n* DaLI output file (the RP2 input file) now has in-transaction crypto_fee. Also updated unit test golden file\n* refactored all transaction constructor calls to use keyword arg calling style\n* updated setup.cfg dependencies to latest RP2\n\n## 0.3.19\n* Trezor plugin: AM/PM was not parsed correctly in timestamp. Fixed.\n* Minor fixes\n\n## 0.3.18\n* fixed a limitation in timestamp processing in Trezor and Trezor Old plugins. The timezone that was passed to the plugin constructor could only be an ISO 8601 format offset: something like \"America/Los Angeles\" would not be accepted. This caused problems with daylight saving timestamps in Trezor CSV files: daylight savings time would just be ignored, thus causing Trezor summer timestamps to be 1 hour off\n* updated input, input/golden, config and docs/configuration_file.md to reflect the above fix\n* added pytz stubs\n\n## v0.3.17\n* added new FAQ on adding support for new wallets and exchanges\n* minor fixes\n\n## v0.3.16\n* Trezor plugin: dusting attack was incorrectly interpreted as cost-only transaction. Now it issues a warning to the user\n* minor fixes to documentation\n\n## v0.3.15\n* minor edits to documentation and metafiles\n\n## v0.3.12\n* fixed a few broken links in README.md (when used from Pypi only)\n* fixed CLI --help description\n* minor improvements to documentation\n\n## v0.3.7\n* major improvements to documentation\n* added notes in generated file to describe crypto conversion transactions in Coinbase Pro\n* small performance improvement: signature reflexive call is now called only once per class, instead of once per instance\n\n## v0.3.6\n* template.ods was missing from the final package. Fixed in setup.cfg\n* various fixes to documentation\n\n## v0.3.4\n* First version tracked in change log and uploaded to Github\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Data loader and input generator for RP2 (https://pypi.org/project/rp2/), the privacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, open-source and it prioritizes user privacy.",
    "version": "0.6.11",
    "project_urls": {
        "Contact": "https://eprbell.github.io/eprbell/about.html",
        "Developer Documentation": "https://github.com/eprbell/dali-rp2/blob/main/README.dev.md",
        "Homepage": "https://github.com/eprbell/dali-rp2",
        "Source Code": "https://github.com/eprbell/dali-rp2",
        "User Documentation": "https://github.com/eprbell/dali-rp2/blob/main/README.md"
    },
    "split_keywords": [
        "accounting",
        " altcoin",
        " bitcoin",
        " btc",
        " capital gains",
        " cost basis",
        " crypto",
        " cryptocurrency",
        " data loader",
        " defi",
        " eth",
        " ethereum",
        " exchange",
        " finance",
        " form 8949",
        " nft",
        " privacy",
        " wallet",
        " tax"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d789f1fcb0c059f06d3fc66cac25f758f7366bf4bdc74f39ee20383915587830",
                "md5": "b1014d8b3b63184b99b85ff5941e2cc3",
                "sha256": "b29a3577772035a61c096ecb7a919b6924ae4f279a4283608b0da15c1980a9c3"
            },
            "downloads": -1,
            "filename": "dali_rp2-0.6.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1014d8b3b63184b99b85ff5941e2cc3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 167193,
            "upload_time": "2024-07-25T02:29:56",
            "upload_time_iso_8601": "2024-07-25T02:29:56.590732Z",
            "url": "https://files.pythonhosted.org/packages/d7/89/f1fcb0c059f06d3fc66cac25f758f7366bf4bdc74f39ee20383915587830/dali_rp2-0.6.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbaf4fce962c527b0ac9c9d8e57c5441fe5ca9ae89a8f4e0684ba3371118ca30",
                "md5": "98465c3aded425d3cd73d4a7b963a74d",
                "sha256": "6ab537d3fa21c006401e82456cc5453f9012271bebe86633a0f1d911c5543e45"
            },
            "downloads": -1,
            "filename": "dali_rp2-0.6.11.tar.gz",
            "has_sig": false,
            "md5_digest": "98465c3aded425d3cd73d4a7b963a74d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 194872,
            "upload_time": "2024-07-25T02:29:58",
            "upload_time_iso_8601": "2024-07-25T02:29:58.573836Z",
            "url": "https://files.pythonhosted.org/packages/db/af/4fce962c527b0ac9c9d8e57c5441fe5ca9ae89a8f4e0684ba3371118ca30/dali_rp2-0.6.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-25 02:29:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eprbell",
    "github_project": "dali-rp2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dali-rp2"
}
        
Elapsed time: 2.00637s