Skip to content

Latest commit

ย 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‡ฎ๐Ÿ‡ช Irish Capital Gains Calculator

A comprehensive Python tool for calculating Irish capital gains tax, ETF exit tax, and dividend income tax from Revolut trading transaction data.

Perfect for Irish tax residents who need to calculate their annual tax obligations from stock and ETF trading. Handles complex scenarios like loss carry forward, mergers, multi-currency transactions, and the 8-year ETF deemed disposal rule.

๐ŸŽฏ Why This Tool?

Irish tax law is complex for investors:

  • Stocks: 33% capital gains tax with โ‚ฌ1,270 exemption and indefinite loss carry forward
  • ETFs: 41% exit tax (up to 2025) / 38% (from 2026) on gains + dividends with 8-year deemed disposal
  • Dividends: Income tax at marginal rate with withholding tax credits
  • Multi-currency: FX conversions required for EUR reporting

This calculator handles all these complexities automatically using your Revolut transaction exports.

๐Ÿš€ Quick Start

# Set up environment (one time only)
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Run with your Revolut export file
python improved_calculator.py revolut_transactions.xlsx

# Try the demo with sample data
python improved_calculator.py samples/sample_revolut_transactions.csv

๐Ÿ“š Documentation

๐Ÿ—๏ธ Project Structure

CapitalGainsCalculatorIE/
โ”œโ”€โ”€ ๐Ÿ“„ README.md                     # This file
โ”œโ”€โ”€ ๐Ÿงฎ improved_calculator.py        # Main entry point
โ”œโ”€โ”€ ๐Ÿ“ฆ requirements.txt              # Python dependencies
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE                       # CC BY-NC-SA 4.0 License
โ”œโ”€โ”€ ๐Ÿšซ .gitignore                    # Git ignore patterns
โ”œโ”€โ”€ ๐Ÿ“ src/                          # Source code
โ”‚   โ”œโ”€โ”€ improved_calculator.py       # Core calculator logic
โ”‚   โ”œโ”€โ”€ tax_calculations.py          # Irish tax functions
โ”‚   โ””โ”€โ”€ ticker_utils.py              # Ticker utilities
โ”œโ”€โ”€ ๐Ÿ“ data/                         # Data files
โ”‚   โ””โ”€โ”€ ticker_cache.json            # Ticker classification cache
โ”œโ”€โ”€ ๐Ÿ“ docs/                         # Documentation
โ”‚   โ”œโ”€โ”€ README.md                    # Full user guide
โ”‚   โ”œโ”€โ”€ project_spec.md              # Technical specification
โ”‚   โ””โ”€โ”€ SAMPLE_OUTPUT.md             # Example output
โ””โ”€โ”€ ๐Ÿ“ samples/                      # Sample transaction files
    โ””โ”€โ”€ sample_revolut_transactions.csv  # Anonymized demo data

โœจ Key Features

  • Irish Tax Compliance: 33% CGT on stocks, 41%/38% exit tax on ETFs
  • FIFO Accounting: Proper cost basis calculation across multiple years
  • Loss Carry Forward: Indefinite carry forward for stock losses
  • Smart Classification: Auto-detects stocks vs ETFs using yfinance API
  • Multi-currency: Converts everything to EUR using your FX rates
  • Complex Scenarios: Handles mergers, inactive stocks, broker transfers

๐Ÿ”ง Usage Examples

# Basic calculation (with Revolut export file)
python improved_calculator.py revolut_transactions.xlsx

# Multiple years with CSV export
python improved_calculator.py revolut_2022.xlsx revolut_2023.xlsx revolut_2024.xlsx --csv

# With dividend tax at your marginal rate
python improved_calculator.py revolut_transactions.xlsx --margin-rate 40

# Analyze specific ticker in detail
python improved_calculator.py revolut_transactions.xlsx --ticker VWCE

# Try with sample Revolut-format data
python improved_calculator.py samples/sample_revolut_transactions.csv

๐Ÿ“‹ Input Format (Revolut Transaction Export)

Note: This calculator is specifically designed and tested with Revolut transaction exports. Other brokers may have different formats.

Your Revolut Excel/CSV export needs these columns:

  • Date: Transaction date
  • Ticker: Stock/ETF symbol (AAPL, VWCE, etc.)
  • Type: BUY, SELL, DIVIDEND, etc.
  • Quantity: Number of shares
  • Price per share: In original currency
  • Total Amount: Total transaction value
  • Currency: EUR, USD, etc.
  • FX Rate: Exchange rate to EUR

๐Ÿ‡ฎ๐Ÿ‡ช Irish Tax Rules Implemented

  • Stock CGT: 33% rate with โ‚ฌ1,270 annual exemption and indefinite loss carry forward
  • ETF Exit Tax: 41% (up to 2025) / 38% (from 2026) on gains and dividends, 8-year deemed disposal rule
  • Dividend Tax: Income tax at marginal rate with withholding tax credits

๐Ÿ“‹ Requirements

  • Python 3.9+
  • Dependencies: pandas, openpyxl, numpy, yfinance
  • Works on macOS, Linux, Windows

๐Ÿค Contributing

Contributions are welcome! This project uses the Creative Commons BY-NC-SA 4.0 license which allows:

  • โœ… Contributions and improvements
  • โœ… Personal and educational use
  • โŒ Commercial use

Please feel free to:

  • Report bugs and issues
  • Suggest new features
  • Submit pull requests
  • Improve documentation

๐Ÿ“œ License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

  • โœ… You can use, modify, and share this software
  • โœ… You can contribute improvements back to the project
  • โŒ You cannot use this software for commercial purposes
  • ๐Ÿ“„ See LICENSE file for full details

โš–๏ธ Legal Notice

This tool calculates taxes based on Irish Revenue guidelines. Always verify with a qualified tax advisor before filing. For educational and personal use only.


Built for Irish residents trading through modern brokers ๐Ÿ‡ฎ๐Ÿ‡ช

About

๐Ÿ‡ฎ๐Ÿ‡ช Comprehensive Irish tax calculator for stock & ETF traders using Revolut. Automatically handles complex Irish tax rules: CGT, exit tax, loss carry forward, multi-currency conversions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages