Interactive Brokers (IBKR) Report Parser for MyTax (vero.fi)
Project description
ibkr-report-parser
Interactive Brokers (IBKR) Report Parser for MyTax (vero.fi) - not affiliated with either service
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
Use the app
Browse to http://127.0.0.1:8080/
Environment variables
TITLE
The title of the website. DefaultIBKR Report Parser
CURRENCY
The currency used in the report output. DefaultEUR
USE_DEEMED_ACQUISITION_COST
Whether to use the deemed acquisition cost, if it benefits you. DefaultTRUE
STORAGE_TYPE
The storage to save the fetched daily Euro exchange rates, if set to anything other thanDISABLED
. Currently supported types areLOCAL
,AWS
, andGCP
. DefaultDISABLED
STORAGE_DIR
The directory used whenSTORAGE_TYPE
is set toLOCAL
. Default.ibkr_storage
BUCKET_ID
The storage bucket used whenSTORAGE_TYPE
is set toAWS
orGCP
. Default""
Testing and debugging
DEBUG
Flask debug. DefaultFALSE
LOGGING_LEVEL
Python logging level. DefaultINFO
EXCHANGE_RATES_URL
URL for the Euro exchange rates from European Central Bank. Defaulthttps://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip
How to build yourself
Python
git clone https://github.com/oittaa/ibkr-report-parser.git
cd ibkr-report-parser
pip install .
ibkr-report-parser
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
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
from ibkr_report.definitions import StorageType
rates = ExchangeRates(storage_type=StorageType.LOCAL, storage_dir="/tmp/my_storage")
print(rates.get_rate("EUR", "USD", "2020-06-20"))
print(rates.get_rate("GBP", "SEK", "2015-12-31"))
Project details
Release history Release notifications | RSS feed
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-2022.1.19.tar.gz
(189.4 kB
view hashes)
Built Distribution
Close
Hashes for ibkr-report-parser-2022.1.19.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 290e80d6d936531f033b784f7b1a87ff9db07ff12bb873c8b0f9af9f917982c3 |
|
MD5 | 84841505038bfd300dc31ef12218726a |
|
BLAKE2b-256 | 633ea20898bb71c56144ed24830ee194052e232333485cc9316b7c2d4264b193 |
Close
Hashes for ibkr_report_parser-2022.1.19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b6d57bf484b34345a2d6279c138e4e740ece73c6a70203852f016a8c826a78 |
|
MD5 | 67c9163985d08f422af67822778a885d |
|
BLAKE2b-256 | 668575e029e163585fbd36a61fdcf6c962696b0baa5b41982199ce54e4119188 |