rp2


Namerp2 JSON
Version 1.7.1 PyPI version JSON
download
home_pagehttps://github.com/eprbell/rp2
SummaryPrivacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports multiple countries and accounting menthods (FIFO, LIFO, HIFO), it features transparent computation for easy result verification, and it generates reports tax accountants can understand (e.g. form 8949).
upload_time2024-06-30 23:15:19
maintainerNone
docs_urlNone
authoreprbell
requires_pythonNone
licenseApache License 2.0
keywords accounting altcoin bitcoin btc capital gains cost basis crypto cryptocurrency defi eth ethereum 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 2021 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 Logo](https://raw.githubusercontent.com/eprbell/rp2/main/docs/images/rp2_header.png)

# RP2 v1.7.1
Privacy-focused, free, powerful crypto tax calculator

[![Static Analysis / Main Branch](https://github.com/eprbell/rp2/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/static_analysis.yml)
[![Documentation Check / Main Branch](https://github.com/eprbell/rp2/actions/workflows/documentation_check.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/documentation_check.yml)
[![Unix Unit Tests / Main Branch](https://github.com/eprbell/rp2/actions/workflows/unix_unit_tests.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/unix_unit_tests.yml)
[![Windows Unit Tests / Main Branch](https://github.com/eprbell/rp2/actions/workflows/windows_unit_tests.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/windows_unit_tests.yml)
[![CodeQL/Main Branch](https://github.com/eprbell/rp2/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/eprbell/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](https://github.com/eprbell/rp2/blob/main/README.md#introduction)**
  * [How RP2 Operates](https://github.com/eprbell/rp2/blob/main/README.md#how-rp2-operates)
* **[License](https://github.com/eprbell/rp2/blob/main/README.md#license)**
* **[Download](https://github.com/eprbell/rp2/blob/main/README.md#download)**
* **[Installation](https://github.com/eprbell/rp2/blob/main/README.md#installation)**
  * [Ubuntu Linux](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-ubuntu-linux)
  * [macOS](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-macos)
  * [Windows 10](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-windows-10)
  * [Other Unix-like Systems](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-other-unix-like-systems)
* **[Running](https://github.com/eprbell/rp2/blob/main/README.md#running)**
* **[Input and Output Files](https://github.com/eprbell/rp2/blob/main/README.md#input-and-output-files)**
* **[Supported Countries](https://github.com/eprbell/rp2/blob/main/README.md#supported-countries)**
* **[RP2 Ecosystem](https://github.com/eprbell/rp2/blob/main/README.md#rp2-ecosystem)**
  * [List of Ecosystem Projects](https://github.com/eprbell/rp2/blob/main/README.md#list-of-ecosystem-projects)
* **[Reporting Bugs](https://github.com/eprbell/rp2/blob/main/README.md#reporting-bugs)**
* **[Contributing](https://github.com/eprbell/rp2/blob/main/README.md#contributing)**
* **[Developer Documentation](https://github.com/eprbell/rp2/blob/main/README.md#developer-documentation)**
* **[Frequently Asked Questions](https://github.com/eprbell/rp2/blob/main/README.md#frequently-asked-questions)**
* **[Change Log](https://github.com/eprbell/rp2/blob/main/README.md#change-log)**

## Introduction
[RP2](https://github.com/eprbell/rp2) is a privacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator for multiple countries (currently US, Japan, Spain and Ireland are supported). Preparing crypto taxes can be a daunting and error-prone task, especially if multiple transactions, coins, exchanges and wallets are involved. This task could be delegated to a crypto tax preparation service, but many crypto users value their privacy and prefer not to send their transaction information to third parties unnecessarily. Additionally, many of these services cost money. RP2 solves all of these problems:
* it manages the complexity related to coin flows and tax calculation and it generates [reports that accountants can understand](https://github.com/eprbell/rp2/blob/main/docs/output_files.md#advisor-friendly-report-tax-report-us-output) (in the format of form 8949, for the US case), even if they are not cryptocurrency experts;
* it prioritizes user privacy by storing crypto transactions and tax results on the user's computer and not sending them anywhere else;
* it's 100% free, open-source and non-commercial.

This means that with RP2 there are no transaction limits, no premium versions, no payment requests, no personal data sent to a server (at risk of being hacked), no account creation, no unauditable source code.

Another unique advantage of RP2 is [transparent computation](https://github.com/eprbell/rp2/blob/main/docs/output_files.md#rp2-full-report-transparent-computation): RP2 generates full computation details for every lot fraction, so that it's possible to:
* verify step-by-step how RP2 reaches the final result;
* track down every lot fraction and its accounting details, in case of an audit.

RP2 supports most [countries](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md) and various [accounting methods](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md): supported accounting methods vary country by country.

RP2 reads a configuration file and an input spreadsheet containing crypto transactions. These [input files](https://github.com/eprbell/rp2/blob/main/docs/input_files.md) can be generated either manually or automatically using [DaLI](https://github.com/eprbell/dali-rp2), a RP2 data loader and input generator (which is also privacy-focused, free, non-commercial, open-source and community-driven). After parsing the input, RP2 uses high-precision math to calculate long/short term capital gains, cost bases, balances, average price, in/out lot relationships/fractions, and finally it generates [output files](https://github.com/eprbell/rp2/blob/main/docs/output_files.md).

RP2 has a programmable plugin architecture for [output generators](https://github.com/eprbell/rp2/tree/main/README.dev.md#adding-a-new-report-generator), [accounting methods](https://github.com/eprbell/rp2/tree/main/README.dev.md#adding-a-new-accounting-method) and [countries](https://github.com/eprbell/rp2/tree/main/README.dev.md#adding-support-for-a-new-country). Built-in [output generator plugins](https://github.com/eprbell/rp2/blob/main/docs/output_files.md) vary [country by country](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md), but RP2's architecture makes it possible to contribute additional generators for different countries or for different country-based cases.

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

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

### How RP2 Operates
RP2 has been designed to have expressive primitives that can be used as building blocks for most tax scenarios: complex tax events can be described with patterns, built on top of these primitives (see the [FAQ list](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#tax-scenarios) for examples).

For the US case, RP2 treats virtual currency as property for tax purposes, as per [IRS Virtual Currency Guidance](https://www.irs.gov/newsroom/irs-reminds-taxpayers-to-report-virtual-currency-transactions).

RP2 supports various accounting methods (e.g. FIFO, LIFO, HIFO): however, in and out lots typically don't have matching amounts, so RP2 fractions them, maps in/out lot fractions and computes the resulting cost basis and capital gains for each lot fraction.

RP2 groups lot fractions into the following taxable event categories, each of which has a [specific tax treatment](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#which-crypto-tax-forms-to-file):
* [AIRDROP](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-airdrops): gains from airdrops;
* [DONATE](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-donations): donations to charitable organizations;
* [FEE](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#hhow-to-handle-fee-only-defi-transactions): fee-only transaction, used in some DeFi scenarios (e.g. gas fee for running certain smart contracts);
* [GIFT](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-gifts): gifts to parties who are not charitable organizations (not tax-deductible).
* [HARDFORK](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-hard-forks): gains from hard forks;
* [INCOME](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-miscellaneous-crypto-income): gains from miscellaneous income (e.g. Coinbase Earn);
* [INTEREST](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-crypto-interest): gains from interest;
* [MINING](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-income-from-mining): gains from mining;
* [MOVE](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-a-transfer-of-funds-from-a-wallet-or-exchange-to-another): the fee for moving currency between two accounts controlled by the same owner;
* SELL: specifically, sale and [conversion of a cryptocurrency to another](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-conversion-of-a-cryptocurrency-to-another). RP2 splits them in two subcategories:
  * long-term capital gains (if supported by the country plugin: e.g. in the US it's 1 year or more), or
  * short-term capital gains otherwise;
* [STAKING](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-income-from-staking): gains from staking;
* [WAGES](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-income-from-crypto-wages): income from crypto wages.

For each of these categories RP2 generates an output spreadsheet with transaction details and computed gains/losses (see [Input and Output Files](https://github.com/eprbell/rp2/blob/main/README.md#input-and-output-files) for more details). Users can give this output to their tax preparer with the rest of their tax documentation (see also FAQ on [which tax forms to file](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#which-crypto-tax-forms-to-file)). Note that buying cryptocurrency using fiat currency is not a taxable event.

**NOTE ON NFTs**: Read the [FAQ on NFTs](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-nfts) to learn about how RP2 treats NFTs.

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

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

## Installation
RP2 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 RP2:
```
pip install rp2
```
### Installation on macOS
First make sure [Homebrew](https://brew.sh) is installed, then open a terminal window and enter the following commands:
```
brew update
brew install python3
```

Then install RP2:
```
pip install 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 open a PowerShell window and enter the following:
```
pip install rp2
```

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

Then install RP2:
```
pip install rp2
```

## Running
RP2 requires two files as input:
* an ODS-format spreadsheet, containing crypto transactions (ODS-format files can be opened and edited with [LibreOffice](https://www.libreoffice.org/) and many other spreadsheet applications);
* a config file, describing the format of the spreadsheet file: what value each column corresponds to (e.g. timestamp, amount, exchange, fee, etc.) and which cryptocurrencies and exchanges to expect.

The two input files can either:
* be generated automatically using [DaLI](https://github.com/eprbell/dali-rp2), the data loader and input generator for RP2, or
* be prepared manually by the user.

The formats of these files are described in detail in the [Input Files](https://github.com/eprbell/rp2/blob/main/docs/input_files.md) section of the documentation.

Examples of an input spreadsheet and its respective config file:
* [input/crypto_example.ods](https://github.com/eprbell/rp2/tree/main/input/crypto_example.ods)
* [config/crypto_example.ini](https://github.com/eprbell/rp2/tree/main/config/crypto_example.ini).

After reading the input files, RP2 computes taxes and generates output files, which contain information on long/short capital gains, cost bases, balances, average price, in/out lot relationships and fractions, etc. They are described in detail in the [Output Files](https://github.com/eprbell/rp2/blob/main/docs/output_files.md) section of the documentation.

To try RP2 with example files, download [crypto_example.ods](https://github.com/eprbell/rp2/tree/main/input/crypto_example.ods) and [crypto_example.ini](https://github.com/eprbell/rp2/tree/main/config/crypto_example.ini). Let's call `<download_directory>` the location of the downloaded files.

The RP2 executable is country-dependent: `rp2_<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. `rp2_us`, `rp2_jp`, etc).

To generate US tax output for the example files open a terminal window (or PowerShell if on Windows) and enter the following commands:
  ```
  cd <download_directory>
  rp2_us -m fifo -o output -p crypto_example_ crypto_example.ini crypto_example.ods
  ```
Results are generated in the `output` directory and logs are stored in the `log` directory.

The `-m` option is particularly important, because is selects the accounting method: `rp2_us` supports FIFO, LIFO and HIFO (if `-m` is not specified it defaults to FIFO).

To print full command usage information for the `rp2_us` command:
  ```
  rp2_us --help
  ```

## Input and Output Files
Read the [input files](https://github.com/eprbell/rp2/blob/main/docs/input_files.md) and [output files](https://github.com/eprbell/rp2/blob/main/docs/output_files.md) documentation.

## Supported Countries
Read the [supported countries](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md) documentation.

## RP2 Ecosystem
This is a call for coders: come and help us expand RP2's functionality!

RP2 is the first component of what could be a powerful, community-driven suite of open-source, crypto tax software. It is intended as the core of a larger project ecosystem, maintained by the community. These projects can extend RP2's capability, usefulness and ease of use in new ways. For example:
* [DaLI data loader plugins](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#dali-internals): add support for more exchanges and wallets (via REST API and/or CSV files). [Dali](https://github.com/eprbell/dali-rp2), the RP2 data loader, uses them to generate an input ODS file and a config file that can be fed directly to RP2;
* [RP2 plugins](https://github.com/eprbell/rp2/tree/main/README.dev.md#plugin-development): RP2 can be expanded via its programmable plugin architecture, which enables support for new output generators, countries and accounting methods;
* RP2 GUI: make RP2 more user-friendly and accessible to people who are not familiar with the CLI;
* RP2 high-level interface: RP2 captures complex tax events using a few powerful, low-level primitives, aggregated in patterns. A higher level tool, might abstract out these patterns and present them to the user in a friendlier way (for example it may capture a complex concept like DeFi bridging as a primitive, rather than a pattern);
* more...

**Important note**: any RP2 ecosystem project must make user privacy its first priority.

If you'd like to start an ecosystem project, please open an [issue](https://github.com/eprbell/rp2/issues) to let the RP2 community know.

### List of Ecosystem Projects
Here's the current list of projects in the RP2 ecosystem:
* [DaLI](https://github.com/eprbell/dali-rp2): data loader and input generator for RP2 (https://github.com/eprbell/rp2).

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

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

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

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

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

<!--- Copyright 2021 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

# 1.7.1
* added generic country plugin (for use in countries that don't have country-specific support yet)
* various improvements to documentation

# 1.6.0
* optimized FIFO accounting from quadratic to linear (#115)
* optimized LIFO and HIFO accounting from quadratic to m*log(n) (#116)
* added support for Ireland (#122)
* added negative staking (#119)
* fixed negative balance bug (#113)
* reworked country-specific documentation: added dedicated page with country-specific information (see docs/supported_countries.md)

## 1.5.1
* re-enabled LIFO and HIFO accounting methods (see discussion at #79)
* added Python 3.11 to test matrix (#107)
* on certain Linux distribution the mpdecimal library is missing, which causes runtime errors. This is now detected and reported to the users (#108)
* added -n CLI option to allow negative balances on exchanges (#106)
* multiple small documentation improvements

## 1.5.0
* added support for Spain (see #97)

## 1.4.2
* fixed small bug in rp2_full_report generator: OUT transactions had slightly incorrect fiat_out field. The displayed value was fiat_out_no_fee - fiat fee, instead of fiat_out_no_fee. This bug didn't affect actual tax computation or the tax_report output: it only affected the fiat_out field in the OUT table of rp2_full_report.

## 1.4.1
* added new RP2RuntimeError to handle non-recoverable problems without using Exception

## 1.4.0
* added support for Japan
* temporarily disable LIFO and HIFO (see https://github.com/eprbell/rp2/issues/79)
* documentation improvements

## 1.3.1
* fixed #77: accounting engine AVLTree keys didn't normalize timezones, which caused a rare but obscure bug in certain cases
* added debug log for progress of tax engine during lot accounting. This should make it much easier to debug certain user data errors, such as "Total in-transaction crypto value < total taxable crypto value"
* fixed tax_report_us plugin bug: investment expenses sheet was resized only with number of move transactions (ignoring number of fee ones): this caused a row overflow when generating tax_report_us output under certain conditions
* minor documentation improvements

## 1.3.0
* configuration files are no longer expressed in JSON format: they now use the INI format. Old JSON-format configuration files can be converted automatically to the new INI format with the following command: rp2_config <json_config>

## 1.2.0
* added support for [switching accounting methods year over year](https://github.com/eprbell/rp2/tree/main/docs/user_faq.md#can-i-change-accounting-method)
* added support for simplified accounting method plugin creation. With this new infrastructure a new accounting method can be added by defining just two small methods. See [documentation](https://github.com/eprbell/rp2/blob/main/README.dev.md#simplified-procedure)
* updated documentation with new accounting method features

## 1.1.0
* fixed 2 bugs in HIFO plugin: see #74 for details. If you're using HIFO, be sure to upgrade to this or later version.
* refactored classic computer science data structures in separate Prezzemolo library
* added FAQs and tweaked documentation

## 1.0.9
* revised and improved all documentation
* added FAQs
* minor fixes

## 1.0.8
* added generated report localization infrastructure: it's now possible to generate taxes for any country in any language (e.g. Japanese taxes in French). See README.dev.md for details
* added -g command line option to select the language to use for generated reports
* default generators are now specified in the country plugin (so that each country can select their allowed generators)
* allowed accounting methods are now specified in the country plugin (so that each country can select their allowed accounting methods)
* minor fixes in the Legend generation code
* updated documentation with new Localization section and updated Country and Report plugin sections with latest API changes
* added user FAQs

## 1.0.6
* added HIFO accounting method plugin
* updated documentation and FAQs

## 1.0.5
* added country plugin for Japan
* small improvements in documentation

## 1.0.4
* fixed issue #39: if ODS file had numeric unique_id it tripped the type checking system
* added support for generators section in configuration: this allows users to select which generator plugins to run. Also deprecated -l/--plugin CLI options
* updated documentation with new generators section description
* added FAQ

## 1.0.3
* minor improvements

## 1.0.2
* new open positions plugin, showing a variety of information on unrealized gains and losses (https://github.com/eprbell/rp2/pull/35)
* minor improvements to documentation

## 1.0.0
* Tax season is over: time for RP2 to hit v1.0.0! RP2 (and DaLI) gained a lot of users and traction in less than one year of existence (https://star-history.com/#eprbell/rp2&Date). During this time lots of bugs were fixed and features added. Thanks to everybody who engaged with PRs, issues, discussions and DMs.

## 0.9.31
* fixed a bug in rp2_full_report generator reported in #31: in out-transactions if crypto_fee == 0 and fiat_fee > 0, the fiat fee was reported as zero (but this affected only the output, not the tax calculation which was correct)
* added some user FAQs

## 0.9.30
* minor improvements to documentation

## 0.9.29
* various improvements to documentation

## 0.9.28
* RP2 logo worked on Github, but not on Pypi: fixed

## 0.9.27
* added RP2 logo to readme.md
* improved an error message when disposed-of crypto is greater than acquired crypto

## 0.9.26
* removed requirements.txt: now using dev section in setup.cfg, which avoids duplication of information
* added FAQ on Excel being unable to open some RP2-generated ODS files

## v0.9.25
* added initial version of developer FAQ document: https://github.com/eprbell/rp2/blob/main/docs/developer_faq.md
* minor refactoring edits

## v0.9.24
* added crypto_fee to InTransactions (by popular demand): previously in-transaction fee would only accept fees in fiat, but in certain situations fee is paid in crypto (e.g. crypto conversion, etc.). With this fix, either crypto_fee or fiat fee can be assigned (not both). If fiat_fee is assigned, crypto_fee is set to 0. If crypto_fee is assigned, fiat_fee is set to crypto_fee * spot_price. The reason for this behavior is that if the fee is paid in fiat, then no crypto is used for the fee, but if the fee is paid in crypto, then its converted fiat value is needed to compute taxes. Note that RP2 models a non-zero crypto_fee with a separate fee-typed out-transaction.
* added new unit test for the new InTransaction crypto_fee (input/test_data4.ods)
* updated documentation to reflect new features from this release
* added a new FAQ on crypto rewards and reworded various answers.

## v0.9.23
* added fee-only transactions: this type of transactions occur in certain DeFi scenarios (see [relevant FAQ](https://github.com/eprbell/rp2/tree/main/docs/user_faq.md#how-to-handle-fee-only-defi-transactions) for more)
* added documentation of transparent computation, including one new FAQ on how to verify RP2 tax computation results: https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-verify-that-tax-computation-is-correct
* minor edits to documentation

## v0.9.19
* added new FAQs
* added pointers in documentation to DaLI, the data loader and input generator for RP2: https://github.com/eprbell/dali-rp2

## v0.9.18
* improved error message when ods_parser._process_constructor_argument_pack tries to parse a numeric argument and fails because the value is not numeric

## v0.9.17
* added an extra check in IntraTransaction constructor: if spot_price == 0 and fee > 0 then raise an error (because the fiat value of the fee cannot be computed)
* minor edits to documentation

## v0.9.16
* in the tax_report_us output the following tabs had the description field mistakenly hidden: Airdrops, Income, Interest, Mining, Staking, Wages. All other tabs didn't have the problem. The hidden field is now visible
* the unique_id field (containing hash or exchange-specific id) is now generated in the output files (both tax_report_us and rp2_full_report)

## v0.9.15
* added Income sheet to plugin ODS template (needed by tax_report_us generator to support the new Income InTransaction type)

## v0.9.14
* added support for Income-type InTransaction (to capture misc income like Coinbase Earn)
* renamed old unique_id field to internal_id and added a new unique_id field to all transactions, which captures hash for IntraTransactions and exchange-specific unique ids for In/OutTransactions
* updated documentation to reflect latest changes
* minor fixes and refactoring

## v0.9.13
* Add py.typed to rp2 package to indicate type hint support.

## v0.9.12
* Added support for multiple logger names (e.g. plugins can use different logger names than core RP2 code).

## v0.9.11
* refactored to_string() method to be top-level, so that it's easier to use in external projects.
* added [RP2 Ecosystem](https://github.com/eprbell/rp2/tree/main/README.md#rp2-ecosystem) paragraph to README.md
* added a few more FAQs to user frequently asked questions document
* improved CLI description
* minor fixes

## v0.9.10
* fixed [issue #6](https://github.com/eprbell/rp2/issues/6): OUT transaction fee is now a deduction as per https://www.irs.gov/publications/p544 and https://taxbit.com/cryptocurrency-tax-guide (previously it was considered part of proceeds and therefore taxed)
* restructured User FAQ document
* added several questions to User FAQ document (many of them DeFi-related)
* various edits and improvements throughout entire documentation

## v0.9.9
* add DONATE and GIFT-typed InTransactions
* changed Legend sheet to include time filter information
* updated documentation to reflect changes in this version

## v0.9.8
* added hyperlinks to rp2_full_report output:
  * taxable events and acquired lots in tax sheet are now hyperlinked to their definition line in the in-out sheet. In LibreOffice, CTRL-click on them to jump to the target (on Mac Command-click)
  * summary lines in the Summary sheet are now hyperlinked to the first line of the given year in the tax sheet
* modified time filter CLI options (-f and -t) to accept a full date (YYYY-MM-DD): so it's now possible to filter transactions before and after a given day
* major refactoring: renamed "from lot" and "in lot" to "acquired lot" throughout identifiers, strings, templates, documentation, etc.
* updated documentation to reflect changes in this version

## v0.9.7
* added profiler instrumentation
* added large input test and refactored ODS output test
* removed rmtree("output") from test_ods_output_diff.py: it modifies the file system, which can cause problems when running tests in parallel (currently not enabled, but that may change in the future).
* minor fixes

## v0.9.6
* fixed a bug in timestamp check: in and out lots were not allowed to have the same timestamp, but in certain scenarios it could happen (e.g. high-frequency trading)
* fixed a subtle corner-case bug in LIFO, which caused the first gain/loss pair to be incorrect: the minimal input that reproduced the bug is now captured in one of the tests (test_data2.ods, sheet B1). This ensures there will not be a regression.
* disable a link check in user faq: the link was failing the check (incorrectly) on Github actions

## v0.9.5
* added new LIFO tests
* minor fixes

## v0.9.4
* added accounting-method programmable plugin infrastructure: by subclassing AbstractAccountingMethod it's now possible to add support for a new accounting method (previously only FIFO was hard-coded in)
* added accounting-method plugins: FIFO, LIFO
* added accounting-method-specific tests, plus additional tests of internal classes (both new and old)
* Added Legend sheet to tax_report_us output
* updated documentation to reflect changes in this version
* minor fixes

## v0.9.3
* added country-specific programmable plugin infrastructure: by subclassing AbstractCountry it's now possible to add support for a new country (currently only US is supported)
* abstracted out currency from APIs and code in general: references to "usd" have been changed to "fiat"
* updated documentation to reflect changes in this version

## v0.9.2
* Verified software is up to date for FY 2021
* Wrote several answers in User FAQ document
* Minor fixes

## v0.8.1
* Added several new tests (from/to_year command line option variations and new transaction types)
* Reworked time filter logic to fix two bugs related to -f and -t options:
  * with time filtering on, running sums reflected only filtered transactions, instead of all transactions (in other words, running sums should not be affected by filtering)
  * with time filtering on, number of fractions reflected also fractions with year higher than time filter
  * with time filtering on, sold lot percentages would be shown incorrectly in some cases
* Updated documentation: various fixes and improvements

## v0.8.0
* added new transaction types: AIRDROP, HARDFORK, INTEREST, MINING, STAKING, WAGES. Removed transaction type EARN, which used to encompass all the above types
* revisited output generators: rp2_report was renamed to rp2_full_report and mock_8949_us was renamed to tax_report_us. The tax_report_us plugin now generates one sheet per taxable event type: Airdrops, Capital Gains, Donations, Gifts, Hard Forks, Interest, Investment Expense, Mining, Staking, Wages.
* fixed bug in from/to_year logic: entry sets didn't consider the time filter in certain corner cases
* updated documentation to reflect above changes

## v0.7.3
* Added from/to_year command line option

## v0.7.2
* Minor fixes related to Pypi package distribution and upload

## v0.7.1
* Minor fixes related to Pypi package distribution and upload

## v0.7.0
* First version uploaded to Pypi
* Added pre-commit hooks
* Added bandit security checks
* Major revision of user and developer documentation
* Fixed lint errors
* Various bug fixes and improvements

## v0.6.0
* First version tracked in change log
* Added Python packaging support
* Switched to high-precision math (decimal.Decimal)
* Finished documentation (except FAQs)
* Added bumpversion
* Various bug fixes and improvements

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eprbell/rp2",
    "name": "rp2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "accounting, altcoin, bitcoin, BTC, capital gains, cost basis, crypto, cryptocurrency, DeFi, ETH, ethereum, finance, form 8949, NFT, privacy, wallet, tax",
    "author": "eprbell",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/98/d3/6fc363f30620335a8ed018debe641e909e549e052355af9050d8bd44aab9/rp2-1.7.1.tar.gz",
    "platform": null,
    "description": "<!--- Copyright 2021 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 Logo](https://raw.githubusercontent.com/eprbell/rp2/main/docs/images/rp2_header.png)\n\n# RP2 v1.7.1\nPrivacy-focused, free, powerful crypto tax calculator\n\n[![Static Analysis / Main Branch](https://github.com/eprbell/rp2/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/static_analysis.yml)\n[![Documentation Check / Main Branch](https://github.com/eprbell/rp2/actions/workflows/documentation_check.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/documentation_check.yml)\n[![Unix Unit Tests / Main Branch](https://github.com/eprbell/rp2/actions/workflows/unix_unit_tests.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/unix_unit_tests.yml)\n[![Windows Unit Tests / Main Branch](https://github.com/eprbell/rp2/actions/workflows/windows_unit_tests.yml/badge.svg)](https://github.com/eprbell/rp2/actions/workflows/windows_unit_tests.yml)\n[![CodeQL/Main Branch](https://github.com/eprbell/rp2/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/eprbell/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](https://github.com/eprbell/rp2/blob/main/README.md#introduction)**\n  * [How RP2 Operates](https://github.com/eprbell/rp2/blob/main/README.md#how-rp2-operates)\n* **[License](https://github.com/eprbell/rp2/blob/main/README.md#license)**\n* **[Download](https://github.com/eprbell/rp2/blob/main/README.md#download)**\n* **[Installation](https://github.com/eprbell/rp2/blob/main/README.md#installation)**\n  * [Ubuntu Linux](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-ubuntu-linux)\n  * [macOS](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-macos)\n  * [Windows 10](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-windows-10)\n  * [Other Unix-like Systems](https://github.com/eprbell/rp2/blob/main/README.md#installation-on-other-unix-like-systems)\n* **[Running](https://github.com/eprbell/rp2/blob/main/README.md#running)**\n* **[Input and Output Files](https://github.com/eprbell/rp2/blob/main/README.md#input-and-output-files)**\n* **[Supported Countries](https://github.com/eprbell/rp2/blob/main/README.md#supported-countries)**\n* **[RP2 Ecosystem](https://github.com/eprbell/rp2/blob/main/README.md#rp2-ecosystem)**\n  * [List of Ecosystem Projects](https://github.com/eprbell/rp2/blob/main/README.md#list-of-ecosystem-projects)\n* **[Reporting Bugs](https://github.com/eprbell/rp2/blob/main/README.md#reporting-bugs)**\n* **[Contributing](https://github.com/eprbell/rp2/blob/main/README.md#contributing)**\n* **[Developer Documentation](https://github.com/eprbell/rp2/blob/main/README.md#developer-documentation)**\n* **[Frequently Asked Questions](https://github.com/eprbell/rp2/blob/main/README.md#frequently-asked-questions)**\n* **[Change Log](https://github.com/eprbell/rp2/blob/main/README.md#change-log)**\n\n## Introduction\n[RP2](https://github.com/eprbell/rp2) is a privacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator for multiple countries (currently US, Japan, Spain and Ireland are supported). Preparing crypto taxes can be a daunting and error-prone task, especially if multiple transactions, coins, exchanges and wallets are involved. This task could be delegated to a crypto tax preparation service, but many crypto users value their privacy and prefer not to send their transaction information to third parties unnecessarily. Additionally, many of these services cost money. RP2 solves all of these problems:\n* it manages the complexity related to coin flows and tax calculation and it generates [reports that accountants can understand](https://github.com/eprbell/rp2/blob/main/docs/output_files.md#advisor-friendly-report-tax-report-us-output) (in the format of form 8949, for the US case), even if they are not cryptocurrency experts;\n* it prioritizes user privacy by storing crypto transactions and tax results on the user's computer and not sending them anywhere else;\n* it's 100% free, open-source and non-commercial.\n\nThis means that with RP2 there are no transaction limits, no premium versions, no payment requests, no personal data sent to a server (at risk of being hacked), no account creation, no unauditable source code.\n\nAnother unique advantage of RP2 is [transparent computation](https://github.com/eprbell/rp2/blob/main/docs/output_files.md#rp2-full-report-transparent-computation): RP2 generates full computation details for every lot fraction, so that it's possible to:\n* verify step-by-step how RP2 reaches the final result;\n* track down every lot fraction and its accounting details, in case of an audit.\n\nRP2 supports most [countries](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md) and various [accounting methods](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md): supported accounting methods vary country by country.\n\nRP2 reads a configuration file and an input spreadsheet containing crypto transactions. These [input files](https://github.com/eprbell/rp2/blob/main/docs/input_files.md) can be generated either manually or automatically using [DaLI](https://github.com/eprbell/dali-rp2), a RP2 data loader and input generator (which is also privacy-focused, free, non-commercial, open-source and community-driven). After parsing the input, RP2 uses high-precision math to calculate long/short term capital gains, cost bases, balances, average price, in/out lot relationships/fractions, and finally it generates [output files](https://github.com/eprbell/rp2/blob/main/docs/output_files.md).\n\nRP2 has a programmable plugin architecture for [output generators](https://github.com/eprbell/rp2/tree/main/README.dev.md#adding-a-new-report-generator), [accounting methods](https://github.com/eprbell/rp2/tree/main/README.dev.md#adding-a-new-accounting-method) and [countries](https://github.com/eprbell/rp2/tree/main/README.dev.md#adding-support-for-a-new-country). Built-in [output generator plugins](https://github.com/eprbell/rp2/blob/main/docs/output_files.md) vary [country by country](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md), but RP2's architecture makes it possible to contribute additional generators for different countries or for different country-based cases.\n\nRP2 has extensive [unit test](https://github.com/eprbell/rp2/tree/main/tests/) coverage to reduce the risk of regression.\n\n**IMPORTANT DISCLAIMERS**:\n* RP2 offers no guarantee of correctness (read the [license](https://github.com/eprbell/rp2/tree/main/LICENSE)): always verify results with the help of a tax professional.\n* The author of RP2 is not a tax professional, but has used RP2 personally for a few years.\n\n### How RP2 Operates\nRP2 has been designed to have expressive primitives that can be used as building blocks for most tax scenarios: complex tax events can be described with patterns, built on top of these primitives (see the [FAQ list](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#tax-scenarios) for examples).\n\nFor the US case, RP2 treats virtual currency as property for tax purposes, as per [IRS Virtual Currency Guidance](https://www.irs.gov/newsroom/irs-reminds-taxpayers-to-report-virtual-currency-transactions).\n\nRP2 supports various accounting methods (e.g. FIFO, LIFO, HIFO): however, in and out lots typically don't have matching amounts, so RP2 fractions them, maps in/out lot fractions and computes the resulting cost basis and capital gains for each lot fraction.\n\nRP2 groups lot fractions into the following taxable event categories, each of which has a [specific tax treatment](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#which-crypto-tax-forms-to-file):\n* [AIRDROP](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-airdrops): gains from airdrops;\n* [DONATE](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-donations): donations to charitable organizations;\n* [FEE](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#hhow-to-handle-fee-only-defi-transactions): fee-only transaction, used in some DeFi scenarios (e.g. gas fee for running certain smart contracts);\n* [GIFT](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-gifts): gifts to parties who are not charitable organizations (not tax-deductible).\n* [HARDFORK](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-hard-forks): gains from hard forks;\n* [INCOME](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-miscellaneous-crypto-income): gains from miscellaneous income (e.g. Coinbase Earn);\n* [INTEREST](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-crypto-interest): gains from interest;\n* [MINING](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-income-from-mining): gains from mining;\n* [MOVE](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-a-transfer-of-funds-from-a-wallet-or-exchange-to-another): the fee for moving currency between two accounts controlled by the same owner;\n* SELL: specifically, sale and [conversion of a cryptocurrency to another](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-conversion-of-a-cryptocurrency-to-another). RP2 splits them in two subcategories:\n  * long-term capital gains (if supported by the country plugin: e.g. in the US it's 1 year or more), or\n  * short-term capital gains otherwise;\n* [STAKING](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-income-from-staking): gains from staking;\n* [WAGES](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-income-from-crypto-wages): income from crypto wages.\n\nFor each of these categories RP2 generates an output spreadsheet with transaction details and computed gains/losses (see [Input and Output Files](https://github.com/eprbell/rp2/blob/main/README.md#input-and-output-files) for more details). Users can give this output to their tax preparer with the rest of their tax documentation (see also FAQ on [which tax forms to file](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#which-crypto-tax-forms-to-file)). Note that buying cryptocurrency using fiat currency is not a taxable event.\n\n**NOTE ON NFTs**: Read the [FAQ on NFTs](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-handle-nfts) to learn about how RP2 treats NFTs.\n\n## License\nRP2 is released under the terms of Apache License Version 2.0. For more information see [LICENSE](https://github.com/eprbell/rp2/tree/main/LICENSE) or <http://www.apache.org/licenses/LICENSE-2.0>.\n\n## Download\nThe latest version of RP2 can be downloaded at: <https://pypi.org/project/rp2/>\n\n## Installation\nRP2 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```\nsudo apt-get update\nsudo apt-get install python3 python3-pip\n```\n\nThen install RP2:\n```\npip install rp2\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```\nbrew update\nbrew install python3\n```\n\nThen install RP2:\n```\npip install rp2\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\"), then open a PowerShell window and enter the following:\n```\npip install rp2\n```\n\n### Installation on Other Unix-like Systems\n* install python 3.8 or greater\n* install pip3\n\nThen install RP2:\n```\npip install rp2\n```\n\n## Running\nRP2 requires two files as input:\n* an ODS-format spreadsheet, containing crypto transactions (ODS-format files can be opened and edited with [LibreOffice](https://www.libreoffice.org/) and many other spreadsheet applications);\n* a config file, describing the format of the spreadsheet file: what value each column corresponds to (e.g. timestamp, amount, exchange, fee, etc.) and which cryptocurrencies and exchanges to expect.\n\nThe two input files can either:\n* be generated automatically using [DaLI](https://github.com/eprbell/dali-rp2), the data loader and input generator for RP2, or\n* be prepared manually by the user.\n\nThe formats of these files are described in detail in the [Input Files](https://github.com/eprbell/rp2/blob/main/docs/input_files.md) section of the documentation.\n\nExamples of an input spreadsheet and its respective config file:\n* [input/crypto_example.ods](https://github.com/eprbell/rp2/tree/main/input/crypto_example.ods)\n* [config/crypto_example.ini](https://github.com/eprbell/rp2/tree/main/config/crypto_example.ini).\n\nAfter reading the input files, RP2 computes taxes and generates output files, which contain information on long/short capital gains, cost bases, balances, average price, in/out lot relationships and fractions, etc. They are described in detail in the [Output Files](https://github.com/eprbell/rp2/blob/main/docs/output_files.md) section of the documentation.\n\nTo try RP2 with example files, download [crypto_example.ods](https://github.com/eprbell/rp2/tree/main/input/crypto_example.ods) and [crypto_example.ini](https://github.com/eprbell/rp2/tree/main/config/crypto_example.ini). Let's call `<download_directory>` the location of the downloaded files.\n\nThe RP2 executable is country-dependent: `rp2_<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. `rp2_us`, `rp2_jp`, etc).\n\nTo generate US tax output for the example files open a terminal window (or PowerShell if on Windows) and enter the following commands:\n  ```\n  cd <download_directory>\n  rp2_us -m fifo -o output -p crypto_example_ crypto_example.ini crypto_example.ods\n  ```\nResults are generated in the `output` directory and logs are stored in the `log` directory.\n\nThe `-m` option is particularly important, because is selects the accounting method: `rp2_us` supports FIFO, LIFO and HIFO (if `-m` is not specified it defaults to FIFO).\n\nTo print full command usage information for the `rp2_us` command:\n  ```\n  rp2_us --help\n  ```\n\n## Input and Output Files\nRead the [input files](https://github.com/eprbell/rp2/blob/main/docs/input_files.md) and [output files](https://github.com/eprbell/rp2/blob/main/docs/output_files.md) documentation.\n\n## Supported Countries\nRead the [supported countries](https://github.com/eprbell/rp2/blob/main/docs/supported_countries.md) documentation.\n\n## RP2 Ecosystem\nThis is a call for coders: come and help us expand RP2's functionality!\n\nRP2 is the first component of what could be a powerful, community-driven suite of open-source, crypto tax software. It is intended as the core of a larger project ecosystem, maintained by the community. These projects can extend RP2's capability, usefulness and ease of use in new ways. For example:\n* [DaLI data loader plugins](https://github.com/eprbell/dali-rp2/blob/main/README.dev.md#dali-internals): add support for more exchanges and wallets (via REST API and/or CSV files). [Dali](https://github.com/eprbell/dali-rp2), the RP2 data loader, uses them to generate an input ODS file and a config file that can be fed directly to RP2;\n* [RP2 plugins](https://github.com/eprbell/rp2/tree/main/README.dev.md#plugin-development): RP2 can be expanded via its programmable plugin architecture, which enables support for new output generators, countries and accounting methods;\n* RP2 GUI: make RP2 more user-friendly and accessible to people who are not familiar with the CLI;\n* RP2 high-level interface: RP2 captures complex tax events using a few powerful, low-level primitives, aggregated in patterns. A higher level tool, might abstract out these patterns and present them to the user in a friendlier way (for example it may capture a complex concept like DeFi bridging as a primitive, rather than a pattern);\n* more...\n\n**Important note**: any RP2 ecosystem project must make user privacy its first priority.\n\nIf you'd like to start an ecosystem project, please open an [issue](https://github.com/eprbell/rp2/issues) to let the RP2 community know.\n\n### List of Ecosystem Projects\nHere's the current list of projects in the RP2 ecosystem:\n* [DaLI](https://github.com/eprbell/dali-rp2): data loader and input generator for RP2 (https://github.com/eprbell/rp2).\n\n## Reporting Bugs\nRead the [Contributing](https://github.com/eprbell/rp2/tree/main/CONTRIBUTING.md#reporting-bugs) document.\n\n## Contributing\nRead the [Contributing](https://github.com/eprbell/rp2/tree/main/CONTRIBUTING.md) document.\n\n## Developer Documentation\nRead the [developer documentation](https://github.com/eprbell/rp2/tree/main/README.dev.md).\n\n## Frequently Asked Questions\nRead the [user FAQ list](https://github.com/eprbell/rp2/blob/main/docs/user_faq.md) and the [developer FAQ list](https://github.com/eprbell/rp2/blob/main/docs/developer_faq.md).\n\n## Change Log\nRead the [Change Log](https://github.com/eprbell/rp2/tree/main/CHANGELOG.md) document.\n\n<!--- Copyright 2021 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# 1.7.1\n* added generic country plugin (for use in countries that don't have country-specific support yet)\n* various improvements to documentation\n\n# 1.6.0\n* optimized FIFO accounting from quadratic to linear (#115)\n* optimized LIFO and HIFO accounting from quadratic to m*log(n) (#116)\n* added support for Ireland (#122)\n* added negative staking (#119)\n* fixed negative balance bug (#113)\n* reworked country-specific documentation: added dedicated page with country-specific information (see docs/supported_countries.md)\n\n## 1.5.1\n* re-enabled LIFO and HIFO accounting methods (see discussion at #79)\n* added Python 3.11 to test matrix (#107)\n* on certain Linux distribution the mpdecimal library is missing, which causes runtime errors. This is now detected and reported to the users (#108)\n* added -n CLI option to allow negative balances on exchanges (#106)\n* multiple small documentation improvements\n\n## 1.5.0\n* added support for Spain (see #97)\n\n## 1.4.2\n* fixed small bug in rp2_full_report generator: OUT transactions had slightly incorrect fiat_out field. The displayed value was fiat_out_no_fee - fiat fee, instead of fiat_out_no_fee. This bug didn't affect actual tax computation or the tax_report output: it only affected the fiat_out field in the OUT table of rp2_full_report.\n\n## 1.4.1\n* added new RP2RuntimeError to handle non-recoverable problems without using Exception\n\n## 1.4.0\n* added support for Japan\n* temporarily disable LIFO and HIFO (see https://github.com/eprbell/rp2/issues/79)\n* documentation improvements\n\n## 1.3.1\n* fixed #77: accounting engine AVLTree keys didn't normalize timezones, which caused a rare but obscure bug in certain cases\n* added debug log for progress of tax engine during lot accounting. This should make it much easier to debug certain user data errors, such as \"Total in-transaction crypto value < total taxable crypto value\"\n* fixed tax_report_us plugin bug: investment expenses sheet was resized only with number of move transactions (ignoring number of fee ones): this caused a row overflow when generating tax_report_us output under certain conditions\n* minor documentation improvements\n\n## 1.3.0\n* configuration files are no longer expressed in JSON format: they now use the INI format. Old JSON-format configuration files can be converted automatically to the new INI format with the following command: rp2_config <json_config>\n\n## 1.2.0\n* added support for [switching accounting methods year over year](https://github.com/eprbell/rp2/tree/main/docs/user_faq.md#can-i-change-accounting-method)\n* added support for simplified accounting method plugin creation. With this new infrastructure a new accounting method can be added by defining just two small methods. See [documentation](https://github.com/eprbell/rp2/blob/main/README.dev.md#simplified-procedure)\n* updated documentation with new accounting method features\n\n## 1.1.0\n* fixed 2 bugs in HIFO plugin: see #74 for details. If you're using HIFO, be sure to upgrade to this or later version.\n* refactored classic computer science data structures in separate Prezzemolo library\n* added FAQs and tweaked documentation\n\n## 1.0.9\n* revised and improved all documentation\n* added FAQs\n* minor fixes\n\n## 1.0.8\n* added generated report localization infrastructure: it's now possible to generate taxes for any country in any language (e.g. Japanese taxes in French). See README.dev.md for details\n* added -g command line option to select the language to use for generated reports\n* default generators are now specified in the country plugin (so that each country can select their allowed generators)\n* allowed accounting methods are now specified in the country plugin (so that each country can select their allowed accounting methods)\n* minor fixes in the Legend generation code\n* updated documentation with new Localization section and updated Country and Report plugin sections with latest API changes\n* added user FAQs\n\n## 1.0.6\n* added HIFO accounting method plugin\n* updated documentation and FAQs\n\n## 1.0.5\n* added country plugin for Japan\n* small improvements in documentation\n\n## 1.0.4\n* fixed issue #39: if ODS file had numeric unique_id it tripped the type checking system\n* added support for generators section in configuration: this allows users to select which generator plugins to run. Also deprecated -l/--plugin CLI options\n* updated documentation with new generators section description\n* added FAQ\n\n## 1.0.3\n* minor improvements\n\n## 1.0.2\n* new open positions plugin, showing a variety of information on unrealized gains and losses (https://github.com/eprbell/rp2/pull/35)\n* minor improvements to documentation\n\n## 1.0.0\n* Tax season is over: time for RP2 to hit v1.0.0! RP2 (and DaLI) gained a lot of users and traction in less than one year of existence (https://star-history.com/#eprbell/rp2&Date). During this time lots of bugs were fixed and features added. Thanks to everybody who engaged with PRs, issues, discussions and DMs.\n\n## 0.9.31\n* fixed a bug in rp2_full_report generator reported in #31: in out-transactions if crypto_fee == 0 and fiat_fee > 0, the fiat fee was reported as zero (but this affected only the output, not the tax calculation which was correct)\n* added some user FAQs\n\n## 0.9.30\n* minor improvements to documentation\n\n## 0.9.29\n* various improvements to documentation\n\n## 0.9.28\n* RP2 logo worked on Github, but not on Pypi: fixed\n\n## 0.9.27\n* added RP2 logo to readme.md\n* improved an error message when disposed-of crypto is greater than acquired crypto\n\n## 0.9.26\n* removed requirements.txt: now using dev section in setup.cfg, which avoids duplication of information\n* added FAQ on Excel being unable to open some RP2-generated ODS files\n\n## v0.9.25\n* added initial version of developer FAQ document: https://github.com/eprbell/rp2/blob/main/docs/developer_faq.md\n* minor refactoring edits\n\n## v0.9.24\n* added crypto_fee to InTransactions (by popular demand): previously in-transaction fee would only accept fees in fiat, but in certain situations fee is paid in crypto (e.g. crypto conversion, etc.). With this fix, either crypto_fee or fiat fee can be assigned (not both). If fiat_fee is assigned, crypto_fee is set to 0. If crypto_fee is assigned, fiat_fee is set to crypto_fee * spot_price. The reason for this behavior is that if the fee is paid in fiat, then no crypto is used for the fee, but if the fee is paid in crypto, then its converted fiat value is needed to compute taxes. Note that RP2 models a non-zero crypto_fee with a separate fee-typed out-transaction.\n* added new unit test for the new InTransaction crypto_fee (input/test_data4.ods)\n* updated documentation to reflect new features from this release\n* added a new FAQ on crypto rewards and reworded various answers.\n\n## v0.9.23\n* added fee-only transactions: this type of transactions occur in certain DeFi scenarios (see [relevant FAQ](https://github.com/eprbell/rp2/tree/main/docs/user_faq.md#how-to-handle-fee-only-defi-transactions) for more)\n* added documentation of transparent computation, including one new FAQ on how to verify RP2 tax computation results: https://github.com/eprbell/rp2/blob/main/docs/user_faq.md#how-to-verify-that-tax-computation-is-correct\n* minor edits to documentation\n\n## v0.9.19\n* added new FAQs\n* added pointers in documentation to DaLI, the data loader and input generator for RP2: https://github.com/eprbell/dali-rp2\n\n## v0.9.18\n* improved error message when ods_parser._process_constructor_argument_pack tries to parse a numeric argument and fails because the value is not numeric\n\n## v0.9.17\n* added an extra check in IntraTransaction constructor: if spot_price == 0 and fee > 0 then raise an error (because the fiat value of the fee cannot be computed)\n* minor edits to documentation\n\n## v0.9.16\n* in the tax_report_us output the following tabs had the description field mistakenly hidden: Airdrops, Income, Interest, Mining, Staking, Wages. All other tabs didn't have the problem. The hidden field is now visible\n* the unique_id field (containing hash or exchange-specific id) is now generated in the output files (both tax_report_us and rp2_full_report)\n\n## v0.9.15\n* added Income sheet to plugin ODS template (needed by tax_report_us generator to support the new Income InTransaction type)\n\n## v0.9.14\n* added support for Income-type InTransaction (to capture misc income like Coinbase Earn)\n* renamed old unique_id field to internal_id and added a new unique_id field to all transactions, which captures hash for IntraTransactions and exchange-specific unique ids for In/OutTransactions\n* updated documentation to reflect latest changes\n* minor fixes and refactoring\n\n## v0.9.13\n* Add py.typed to rp2 package to indicate type hint support.\n\n## v0.9.12\n* Added support for multiple logger names (e.g. plugins can use different logger names than core RP2 code).\n\n## v0.9.11\n* refactored to_string() method to be top-level, so that it's easier to use in external projects.\n* added [RP2 Ecosystem](https://github.com/eprbell/rp2/tree/main/README.md#rp2-ecosystem) paragraph to README.md\n* added a few more FAQs to user frequently asked questions document\n* improved CLI description\n* minor fixes\n\n## v0.9.10\n* fixed [issue #6](https://github.com/eprbell/rp2/issues/6): OUT transaction fee is now a deduction as per https://www.irs.gov/publications/p544 and https://taxbit.com/cryptocurrency-tax-guide (previously it was considered part of proceeds and therefore taxed)\n* restructured User FAQ document\n* added several questions to User FAQ document (many of them DeFi-related)\n* various edits and improvements throughout entire documentation\n\n## v0.9.9\n* add DONATE and GIFT-typed InTransactions\n* changed Legend sheet to include time filter information\n* updated documentation to reflect changes in this version\n\n## v0.9.8\n* added hyperlinks to rp2_full_report output:\n  * taxable events and acquired lots in tax sheet are now hyperlinked to their definition line in the in-out sheet. In LibreOffice, CTRL-click on them to jump to the target (on Mac Command-click)\n  * summary lines in the Summary sheet are now hyperlinked to the first line of the given year in the tax sheet\n* modified time filter CLI options (-f and -t) to accept a full date (YYYY-MM-DD): so it's now possible to filter transactions before and after a given day\n* major refactoring: renamed \"from lot\" and \"in lot\" to \"acquired lot\" throughout identifiers, strings, templates, documentation, etc.\n* updated documentation to reflect changes in this version\n\n## v0.9.7\n* added profiler instrumentation\n* added large input test and refactored ODS output test\n* removed rmtree(\"output\") from test_ods_output_diff.py: it modifies the file system, which can cause problems when running tests in parallel (currently not enabled, but that may change in the future).\n* minor fixes\n\n## v0.9.6\n* fixed a bug in timestamp check: in and out lots were not allowed to have the same timestamp, but in certain scenarios it could happen (e.g. high-frequency trading)\n* fixed a subtle corner-case bug in LIFO, which caused the first gain/loss pair to be incorrect: the minimal input that reproduced the bug is now captured in one of the tests (test_data2.ods, sheet B1). This ensures there will not be a regression.\n* disable a link check in user faq: the link was failing the check (incorrectly) on Github actions\n\n## v0.9.5\n* added new LIFO tests\n* minor fixes\n\n## v0.9.4\n* added accounting-method programmable plugin infrastructure: by subclassing AbstractAccountingMethod it's now possible to add support for a new accounting method (previously only FIFO was hard-coded in)\n* added accounting-method plugins: FIFO, LIFO\n* added accounting-method-specific tests, plus additional tests of internal classes (both new and old)\n* Added Legend sheet to tax_report_us output\n* updated documentation to reflect changes in this version\n* minor fixes\n\n## v0.9.3\n* added country-specific programmable plugin infrastructure: by subclassing AbstractCountry it's now possible to add support for a new country (currently only US is supported)\n* abstracted out currency from APIs and code in general: references to \"usd\" have been changed to \"fiat\"\n* updated documentation to reflect changes in this version\n\n## v0.9.2\n* Verified software is up to date for FY 2021\n* Wrote several answers in User FAQ document\n* Minor fixes\n\n## v0.8.1\n* Added several new tests (from/to_year command line option variations and new transaction types)\n* Reworked time filter logic to fix two bugs related to -f and -t options:\n  * with time filtering on, running sums reflected only filtered transactions, instead of all transactions (in other words, running sums should not be affected by filtering)\n  * with time filtering on, number of fractions reflected also fractions with year higher than time filter\n  * with time filtering on, sold lot percentages would be shown incorrectly in some cases\n* Updated documentation: various fixes and improvements\n\n## v0.8.0\n* added new transaction types: AIRDROP, HARDFORK, INTEREST, MINING, STAKING, WAGES. Removed transaction type EARN, which used to encompass all the above types\n* revisited output generators: rp2_report was renamed to rp2_full_report and mock_8949_us was renamed to tax_report_us. The tax_report_us plugin now generates one sheet per taxable event type: Airdrops, Capital Gains, Donations, Gifts, Hard Forks, Interest, Investment Expense, Mining, Staking, Wages.\n* fixed bug in from/to_year logic: entry sets didn't consider the time filter in certain corner cases\n* updated documentation to reflect above changes\n\n## v0.7.3\n* Added from/to_year command line option\n\n## v0.7.2\n* Minor fixes related to Pypi package distribution and upload\n\n## v0.7.1\n* Minor fixes related to Pypi package distribution and upload\n\n## v0.7.0\n* First version uploaded to Pypi\n* Added pre-commit hooks\n* Added bandit security checks\n* Major revision of user and developer documentation\n* Fixed lint errors\n* Various bug fixes and improvements\n\n## v0.6.0\n* First version tracked in change log\n* Added Python packaging support\n* Switched to high-precision math (decimal.Decimal)\n* Finished documentation (except FAQs)\n* Added bumpversion\n* Various bug fixes and improvements\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Privacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports multiple countries and accounting menthods (FIFO, LIFO, HIFO), it features transparent computation for easy result verification, and it generates reports tax accountants can understand (e.g. form 8949).",
    "version": "1.7.1",
    "project_urls": {
        "Contact": "https://eprbell.github.io/eprbell/about.html",
        "Developer Documentation": "https://github.com/eprbell/rp2/blob/main/README.dev.md",
        "Homepage": "https://github.com/eprbell/rp2",
        "Source Code": "https://github.com/eprbell/rp2",
        "User Documentation": "https://github.com/eprbell/rp2/blob/main/README.md"
    },
    "split_keywords": [
        "accounting",
        " altcoin",
        " bitcoin",
        " btc",
        " capital gains",
        " cost basis",
        " crypto",
        " cryptocurrency",
        " defi",
        " eth",
        " ethereum",
        " finance",
        " form 8949",
        " nft",
        " privacy",
        " wallet",
        " tax"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29f511333b135bbaae412eb93a1715362e6880287b2f20e038b6f43a7d018be3",
                "md5": "a0e59ce88926a5bf8b89a048b90dfbf2",
                "sha256": "9a3c60d0dcc76dd6c77fa6defb80d7be2dfb066e4ed6a9f4ae896ffd66e29797"
            },
            "downloads": -1,
            "filename": "rp2-1.7.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a0e59ce88926a5bf8b89a048b90dfbf2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 557450,
            "upload_time": "2024-06-30T23:15:16",
            "upload_time_iso_8601": "2024-06-30T23:15:16.250997Z",
            "url": "https://files.pythonhosted.org/packages/29/f5/11333b135bbaae412eb93a1715362e6880287b2f20e038b6f43a7d018be3/rp2-1.7.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98d36fc363f30620335a8ed018debe641e909e549e052355af9050d8bd44aab9",
                "md5": "829e65bd0563bc4ab06416620ae0a007",
                "sha256": "6b825e2505571a19b67201c5908a193efdd57afda92e0488d239d1750a40a7cd"
            },
            "downloads": -1,
            "filename": "rp2-1.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "829e65bd0563bc4ab06416620ae0a007",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6226704,
            "upload_time": "2024-06-30T23:15:19",
            "upload_time_iso_8601": "2024-06-30T23:15:19.265974Z",
            "url": "https://files.pythonhosted.org/packages/98/d3/6fc363f30620335a8ed018debe641e909e549e052355af9050d8bd44aab9/rp2-1.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-30 23:15:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eprbell",
    "github_project": "rp2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rp2"
}
        
Elapsed time: 0.97458s