Polish investment tax calculator (PIT-38) for stocks and cryptocurrency
Project description
PIT-38 — Polish Investment Tax Calculator
A command-line tool for calculating Polish income tax on stocks and cryptocurrency (PIT-38 form). It imports transaction history from popular brokers, converts foreign currencies to PLN using official NBP exchange rates, and computes your tax liability.
Supported Brokers
| Broker | Stocks | Crypto |
|---|---|---|
| Revolut | Yes | Yes |
| E*Trade | Yes | — |
| IBI Capital | Yes (SELL-side, PDF input) | — |
| Binance | — | Yes |
| Manual CSV | Yes | Yes |
For broker-specific quirks see docs/BROKERS.md.
Quick Start
Install
pipx install pit-38
Or from source:
pipx install .
Calculate stock tax
pit38 stock -f transactions.csv -y 2025
Calculate crypto tax
pit38 crypto -f transactions.csv -y 2025
Import from broker
Convert your broker's export into the standardized CSV format:
pit38 import revolut-stock -i revolut_export.csv -o transactions.csv
pit38 import revolut-crypto -i revolut_export.csv -o transactions.csv
pit38 import etrade -i etrade_export.csv -o transactions.csv
pit38 import binance -i binance_export.csv -o transactions.csv
pit38 import ibi-capital -i ~/ibi_orders/ -o transactions.csv # PDF input (single file or directory)
You can combine multiple files from different brokers:
pit38 stock -f revolut.csv -f etrade.csv -y 2025
Manual CSV format
You can also prepare transaction files manually. See the example formats:
- Stocks:
pit38/data_sources/stock_loader/example_format.csv - Crypto:
pit38/data_sources/crypto_loader/example_format.csv
Tax Rules
This calculator implements Polish tax law for capital gains (PIT-38). For a detailed description of the rules, see:
How It Works
- Import — broker plugins convert proprietary CSV exports into a standardized format
- Exchange — foreign currency amounts are converted to PLN using NBP average rates (table A) from the last business day before each transaction
- Calculate — stock profits use the FIFO method; crypto uses yearly cost/income aggregation
- Tax — 19% flat tax rate is applied, with automatic deduction of losses from previous years
Contributing
Contributions are welcome — including first-time open-source PRs and new broker plugins. See CONTRIBUTING.md for dev setup, test conventions, PR guidelines, and a walkthrough for adding a new broker plugin.
Quick dev setup:
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/
This project follows the Contributor Covenant v2.1.
Disclaimer
This tool is provided for informational purposes only and does not constitute tax advice. Always verify your calculations with a qualified tax advisor before filing your PIT-38 declaration.
Community
- GitHub Discussions — tax-rule Q&A, broker requests, feedback. English and Polish both welcome.
- Issue tracker — bug reports and feature requests.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pit_38-2026.4.26.tar.gz.
File metadata
- Download URL: pit_38-2026.4.26.tar.gz
- Upload date:
- Size: 59.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9daeae938ff44945e574b1d4f1d613849b288d1a304cad05dc51ce8d6cc0cbb1
|
|
| MD5 |
fc36d59a6155d269fe93a28c900cae2a
|
|
| BLAKE2b-256 |
aebb51310ed9e91f3c3062d8f51c28202a427cd0c7fe55d96b1bb03978f24cdf
|
File details
Details for the file pit_38-2026.4.26-py3-none-any.whl.
File metadata
- Download URL: pit_38-2026.4.26-py3-none-any.whl
- Upload date:
- Size: 89.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2ddf04f20a2448ee3a0c83e483e5d2746c21f43f91cd2980d5d9adf5bd69146
|
|
| MD5 |
1dab9c85df3f0628a94f488cbc1503d3
|
|
| BLAKE2b-256 |
3db8686f6a8370ae8363c7029f3773da330a123f5f99a097e1047f4c7ef39526
|