Skip to content

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

License

Notifications You must be signed in to change notification settings

eprbell/dali-rp2

Repository files navigation

DaLI for RP2 v0.6.11

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

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

Tweet

Table of Contents

Introduction

DaLI (Data Loader Interface) is a data loader and input generator for 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 (both CSV and REST-based), pair converters and countries. 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 open issues or open a new one.

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.
  • 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 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:

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.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++ 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:

pip install dali-rp2

Installation on Other Unix-like Systems

  • install python 3.8 or greater
  • install pip3

Then install DaLI:

pip install dali-rp2

Running

DaLI reads in a user-prepared configuration file in INI format, 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 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.

The DaLI executable is country-dependent: dali_<country_code>, where country code is a ISO 3166-1 alpha-2, 2-letter identifier (e.g. dali_us, dali_jp, etc).

Provided DaLI is installed, 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.

mkdir -p input

If your system has wget:

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:

And move the csv files to the input directory:

mv *.csv input

Then generate the US output files for rp2:

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:

dali_us --help

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

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 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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published