Coder Social home page Coder Social logo

alexanderbabel / t212-taxes Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 0.0 21 KB

This is a simple script that can help you with your tax statement. It's parsing the CSV file that can be exported from Trading212 in order to give you an overview of received dividends and profits/losses.

TypeScript 100.00%
trading212 taxes csv

t212-taxes's Introduction

T212 Taxes

This is a simple script that can help you with your tax statement. It's parsing the CSV file that can be exported from Trading212 in order to give you an overview of received dividends and profits/losses.

How to use this script

  1. Clone/Download this repo
  2. Make sure you have NodeJS 14 or higher installed.
  3. Install the dependencies of this project. I recommend Yarn, but you can also use npm. Yarn: yarn NPM: npm install
  4. Start the script with yarn parse --help or npm run parse -- --help in order to see the script help output
  5. Run the script with the path to the csv as a parameter: yarn parse <path to csv> or npm run parse -- <path to csv>

Help output

Usage: parse [options] <path-to-csv>

Prints out your profits and dividends from Trading212

Arguments:
  path-to-csv                         The path to the CSV that you downloaded from Trading212

Options:
  -c, --currency <currency>           The currency of your Trading212 account (choices: "EUR", "USD", "GBX", default: "EUR")
  -co, --country-code <country code>  The country code (e.g. DE, UK) of the country you are in. (Only needed if you are using the domestic option) (default: "DE")
  -d, --domestic                      Use this option if you want to show domestic profits and dividends separately (default: false)
  -h, --help                          display help for command

Example outputs

Command: yarn parse csv/2020.csv --country-code DE --currency EUR --domestic

[CSV Parser] File: csv/2020.csv
[CSV Parser] Parsed 100 rows

      --------- Dividends ---------

      ----- Domestic EUR Dividends -----
      Dividends (Total): 25 EUR
      Dividends (Tax): 0 EUR


      ----- Foreign EUR Dividends -----
      Dividends (Total): 0 EUR
      Dividends (Tax): 0 EUR

      ----- Foreign USD Dividends -----
      Dividends (Total): 50 EUR
      Dividends (Tax): 10 EUR

      ----- Foreign GBX Dividends -----
      Dividends (Total): 0 EUR
      Dividends (Tax): 0 EUR

      ------------ P/L ------------

      ----- Domestic EUR P/L -----
      Profits: 100 EUR
      Losses: -50 EUR
      Total: 50 EUR


      ----- Foreign EUR P/L -----
      Profits: 0 EUR
      Losses: 0 EUR
      Total: 0 EUR

      ----- Foreign USD P/L -----
      Profits: 1000 EUR
      Losses: -200 EUR
      Total: 800 EUR

      ----- Foreign GBX P/L -----
      Profits: 0 EUR
      Losses: 0 EUR
      Total: 0 EUR

Command: yarn parse csv/2020.csv --country-code DE --currency EUR

[CSV Parser] File: csv/2020.csv
[CSV Parser] Parsed 100 rows

      --------- Dividends ---------

      ----- EUR Dividends -----
      Dividends (Total): 25 EUR
      Dividends (Tax): 0 EUR

      ----- USD Dividends -----
      Dividends (Total): 50 EUR
      Dividends (Tax): 10 EUR

      ----- GBX Dividends -----
      Dividends (Total): 0 EUR
      Dividends (Tax): 0 EUR

      ------------ P/L ------------

      ----- EUR P/L -----
      Profits: 100 EUR
      Losses: -50 EUR
      Total: 50 EUR

      ----- USD P/L -----
      Profits: 1000 EUR
      Losses: -200 EUR
      Total: 800 EUR

      ----- GBX P/L -----
      Profits: 0 EUR
      Losses: 0 EUR
      Total: 0 EUR

t212-taxes's People

Contributors

alexanderbabel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.