eprbell / rp2

Privacy-focused, free, open-source cryptocurrency tax calculator for multiple countries: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports FIFO, LIFO, HIFO and it outputs in form 8949 format. It has a programmable plugin architecture
https://pypi.org/project/rp2/
Apache License 2.0
286 stars 45 forks source link

Add Support for Spain #61

Open eprbell opened 2 years ago

eprbell commented 2 years ago

RP2 and DaLI have a programmable plugin architecture for countries, accounting methods, report generators and more. Adding support for a new country is a high-impact activity because it allows many new potential users to get access to RP2 and DaLI.

Here's how to add support for a new country:

  1. add a new country plugin to RP2;
  2. if the country requires accounting methods that aren't already supported in RP2, add the necessary accounting method plugins;
  3. ensure any newly added accounting methods are reflected in the country plugin's get_default_accounting_method() and get_accounting_methods() methods;
  4. optionally, new country-specific report generators can be added. The built-in report generators (i.e. rp2_full_report and open_positions) are automatically supported;
  5. only for non-English speaking countries: translations for the built-in report generators and for any new report generator can be added;
  6. ensure any newly added report generators are reflected in the country plugin's get_report_generators() method;
  7. add the same country plugin to DaLI. The implementation on the DaLI side is trivial: it's just an entry point instantiating the RP2 country plugin and passing it to the main function;
  8. update the documentation of RP2 and DaLI to reflect the new country, accounting methods (if any) and report generators (if any).

If you notice the country-specific infrastructure is missing a feature that is required to express taxes for the new country, open an issue to let the RP2 community know.

Larision commented 1 year ago

Hi, i´m trying (i´m not a programmer) add support to spain, i´ve country plugin, translations and using full_report, but i have a problem with templates in dali-rp2 showing fiat in $. template.ods not country-specific and i dont know how to solve it. any tip? Thanks

macanudo527 commented 1 year ago

The template is country-specific. You'll have to make a new one for Spain in order for the currency to show in Euros. If you submit a PR, we could probably walk you through it.

eprbell commented 1 year ago

The template is country-specific. You'll have to make a new one for Spain in order for the currency to show in Euros. If you submit a PR, we could probably walk you through it.

Yes, and you can also look at the plugin for Japan, which already went through the procedure. Here are a few relevant bits: