Skip to main content

Data loader and input generator for RP2 (https://pypi.org/project/rp2/), the privacy-focused, free, open-source US 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.

Project description

DaLI for RP2 v0.4.2

Static Analysis / Main Branch Documentation Check / Main Branch Unix Unit Tests / Main Branch Windows Unit Tests / Main Branch CodeQL/Main Branch

Table of Contents

Introduction

DaLI (Data Loader Interface) is a data loader and input generator for RP2, the privacy-focused, free, open-source US 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 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 JSON configuration file.

DaLI has a programmable plugin architecture for data loaders (both CSV and REST-based). 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 plugins for exchanges and wallets! Check data-loader-plugin open issues.

DaLI has unit test 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): always verify results with the help of a tax professional.

License

DaLI is released under the terms of Apache License Version 2.0. For more information see 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.7.0 or greater.

Installation on Ubuntu Linux

Open a terminal window and enter the following commands:

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

Then install DaLI:

pip install dali-rp2

Installation on macOS

First make sure Homebrew is installed, then open a terminal window and enter the following commands:

brew update
brew install python3

Then install DaLI:

pip install dali-rp2

Installation on Windows 10

First make sure Python 3.7 or greater is installed (in the Python installer window be sure to click on "Add Python to PATH"), then open a PowerShell window and enter the following:

pip install dali-rp2

Installation on Other Unix-like Systems

  • install python 3.7 or greater
  • install pip3
  • pip install dali-rp2

Running

DaLI reads in a user-prepared configuration file in INI format, which is used to initialize data loaders (plugins) and configure DaLI's behavior. The format of the configuration file is described in detail in the configuration file documentation.

An example of a configuration file can be found in 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.

To try DaLI with the example configuration, download the following files:

Let's call <download_directory> the location of the downloaded files. To generate RP2 input files, open a terminal window (or PowerShell if on Windows) and enter the following commands:

cd <download_directory>
mkdir input
mv *.csv input
dali -s -o output -p test_ test_config.ini

The -s option allows DaLI to retrieve spot price information from Coinbase Pro, when it's not available from the CSV files or REST services.

The ODS output file is generated in the output directory (or wherever specified with the -o option).

To print command usage information for the dali command:

dali --help

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

cd <download_directory>
rp2_us -m fifo -o output/ -p rp2_ output/test_crypto_data.config output/test_crypto_data.ods
rp2_us -m lifo -o output/ -p rp2_ output/test_crypto_data.config output/test_crypto_data.ods

Configuration File

Read the configuration file documentation.

Reporting Bugs

Read the Contributing document.

Contributing

Read the Contributing document.

Developer Documentation

Read the developer documentation.

Frequently Asked Questions

Read the user FAQ list and the developer FAQ list.

Change Log

Read the Change Log document.

RP2 Change Log

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dali-rp2-0.4.2.tar.gz (83.3 kB view details)

Uploaded Source

Built Distribution

dali_rp2-0.4.2-py3-none-any.whl (73.0 kB view details)

Uploaded Python 3

File details

Details for the file dali-rp2-0.4.2.tar.gz.

File metadata

  • Download URL: dali-rp2-0.4.2.tar.gz
  • Upload date:
  • Size: 83.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for dali-rp2-0.4.2.tar.gz
Algorithm Hash digest
SHA256 fb5b3813a11aaa003c3b98e68155ab1fd6ea153b90bf79351353e185506dd851
MD5 3c721d1032df38d6ba49364f69f99a15
BLAKE2b-256 b7f97d21bf123c59a047669533e2d1d40db5a3f72ffa5bc88ad33fc1dbbf05cb

See more details on using hashes here.

File details

Details for the file dali_rp2-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: dali_rp2-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for dali_rp2-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dbd8c4e5adb2a52db586cf6572c9a7d4937021f15c25db5d5d02ed7fcd76500d
MD5 55c19f893a322a1828cfadd24d69cdd3
BLAKE2b-256 87296351d209d2324385bc854bcfe8d375582f4d54f748f8ed056caf04d4add1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page