Skip to main content

Interactive Brokers (IBKR) Report Parser for MyTax (vero.fi)

Project description

ibkr-report-parser

CI codecov Code style: black

Interactive Brokers (IBKR) Report Parser for MyTax (vero.fi) - not affiliated with either service

Example

Example

How to run locally

Option 1: pip

pip install ibkr-report-parser
ibkr-report-parser

Option 2: Docker

docker pull ghcr.io/oittaa/ibkr-report-parser
docker run --rm -d -p 8080:8080 --name ibkr-report-parser ghcr.io/oittaa/ibkr-report-parser

Option 3: Build yourself

Python

git clone https://github.com/oittaa/ibkr-report-parser.git
cd ibkr-report-parser
pip install -r requirements.txt
python main.py

Docker

git clone https://github.com/oittaa/ibkr-report-parser.git
cd ibkr-report-parser
docker build -t ibkr-report-parser:latest .
docker run --rm -d -p 8080:8080 --name ibkr-report-parser ibkr-report-parser

Use the app

Browse to http://127.0.0.1:8080/

Python API

from ibkr_report import Report

FILE_1 = "test-data/data_single_account.csv"
FILE_2 = "test-data/data_multi_account.csv"

with open(FILE_1, "rb") as file:
    report = Report(file=file, report_currency="EUR", use_deemed_acquisition_cost=True)

with open(FILE_2, "rb") as file:
    report.add_trades(file=file)

print(f"Total selling prices: {report.prices}")
print(f"Total capital gains: {report.gains}")
print(f"Total capital losses: {report.losses}")

for item in report.details:
    print(
        f"{item.symbol=}, {item.quantity=}, {item.buy_date=}, "
        f"{item.sell_date=}, {item.price=}, {item.realized=}"
    )
from ibkr_report import ExchangeRates

rates = ExchangeRates()
print(rates.get_rate("EUR", "USD", "2020-06-20"))
print(rates.get_rate("GBP", "SEK", "2015-12-31"))

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

ibkr-report-parser-2021.11.19.tar.gz (186.4 kB view hashes)

Uploaded Source

Built Distribution

ibkr_report_parser-2021.11.19-py3-none-any.whl (187.7 kB view hashes)

Uploaded Python 3

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