UK capital gains tax calculator for Schwab and Trading212 accounts
Project description
UK capital gains calculator
Calculate capital gains tax by transaction history exported from Schwab/Trading212 and generate PDF report with calculations. Automatically convert all prices to GBP and apply HMRC rules to calculate capital gains tax: "same day" rule, "bed and breakfast" rule, section 104 holding.
Report example
Setup
On Mac:
brew install --cask mactex-no-gui
pip install -r requirements.txt
Usage
schwab_transactions.csv: the exported transaction history from Schwab since the beginning. Or at least since you first acquired the shares, which you were holding during the tax year. You can probably convert transactions from other brokers to Schwab format.trading212/: the exported transaction history from Trading212 since the beginning. Or at least since you first acquired the shares, which you were holding during the tax year. You can put several files here since Trading212 limit the statements to 1 year periods.GBP_USD_monthly_history.csv: monthly GBP/USD prices from gov.uk.initial_prices.csv: stock prices in USD at the moment of vesting, split, etc.- Run
python3 calc.py --tax_year 2020 --schwab schwab_transactions.csv --trading212 trading212/(you can omit the brokers you don't use) - Use
python3 calc.py --helpfor more details/options.
Testing
pip install pytest
pytest
Disclaimer
Please be aware that I'm not a tax adviser so use this data at your own risk.
Contribute
If you notice any bugs feel free to open an issue or send a PR.
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 cgt-calc-0.1.0.tar.gz.
File metadata
- Download URL: cgt-calc-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Darwin/19.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd5466a1a9e50d04bad12787dcf27eb57a13281e6b677cd6e16a86879d299a2d
|
|
| MD5 |
1f1f2f2d5dc2ec69eea1563aa1636aa0
|
|
| BLAKE2b-256 |
5dd5d72bc64fb853870909f4ddd21e1d910f70280c03a8d781f79b984d4cdf6d
|
File details
Details for the file cgt_calc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cgt_calc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Darwin/19.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6fddc1c6f0167691631631ee4c8df07d0e343fbe65c8cfc71c5484503fde933
|
|
| MD5 |
98ed007e0e5280b616ef3ad0fcd2ef5f
|
|
| BLAKE2b-256 |
c4338c73c2dd696886c49d5ea5f92e21d9c268f2c2eec0a729964ca5fe574f1c
|