Skip to content

dominikmessner/tax-etrade

Repository files navigation

Austrian Tax Engine for E-Trade RSUs and ESPP

Calculates capital gains tax using the Austrian moving average cost basis method (Gleitender Durchschnittspreis) for stocks acquired through RSU vesting and ESPP purchases.

⚠️ DISCLAIMER: This software is provided "as is", without warranty of any kind. Use at your own risk. The calculations are based on my understanding of Austrian tax law and may contain errors. This tool is not a substitute for professional tax advice. Always verify the results with a qualified tax advisor (Steuerberater) before filing your tax return. The author(s) assume no liability for any financial losses, penalties, or other damages arising from the use of this software.

Easy Start (Mac Users)

If you are not a developer, you can simply use the provided script:

  1. Download the entire project as a ZIP from GitHub (click "Code" → "Download ZIP") and extract it.
  2. Double-click the run_tax_engine.command file inside the extracted folder.
  3. It will automatically set up Python, install dependencies, and open a menu.
  4. Follow the menu options to Login, Download Data, and Calculate Tax.

Note: The first time you run it, you might need to right-click and select "Open" if macOS warns about an unidentified developer, or allow it in System Settings.

Easy Start (Windows Users)

If you are not a developer, you can simply use the provided script:

  1. Download the entire project as a ZIP from GitHub (click "Code" → "Download ZIP") and extract it.
  2. Double-click the run_tax_engine.bat file inside the extracted folder.
  3. It will automatically set up Python, install dependencies, and open a menu.
  4. Follow the menu options to Login, Download Data, and Calculate Tax.

Easy Start (Linux Users)

If you are not a developer, you can use the same script as Mac users:

  1. Download the entire project as a ZIP from GitHub (click "Code" → "Download ZIP") and extract it.
  2. Open a terminal in the extracted folder and run:
    chmod +x run_tax_engine.command
    ./run_tax_engine.command
  3. It will automatically set up Python, install dependencies, and open a menu.
  4. Follow the menu options to Login, Download Data, and Calculate Tax.

Easy Start (Devcontainer)

In Visual Studio Code, open this workspace using the Dev Containers extension to run it inside the provided development container.

The container includes a lightweight desktop (fluxbox) and a Chromium browser installed via Playwright (will be installed after creating the container).

Security note: The container runs with elevated privileges so Playwright's Chromium can run correctly. This isolates the container's browser from your host browser but is not a hardened sandbox - do not rely on it as an unescapable security boundary for untrusted code.

Access the desktop:

  • Open in a browser at http://localhost:6080
  • Or connect with a VNC client on port 5901 (port may vary; check the VS Code "Ports" tab)

Start the download assistant (it opens the browser inside the container):

uv run tax-download

Use the assistant to log in to E-Trade and download the required files (ESPP history, Orders, RSU confirmations).

Developer Quick Start

1. Setup environment

brew install uv
uv sync --all-extras
uv run pre-commit install

2. Run Demo

To see the tax engine in action with sample data:

uv run demo.py

3. Fetch Your Data

To automate downloading transaction history from E-Trade:

  1. Install Playwright browsers (first time only):

    uv run playwright install chromium
  2. Run the download assistant:

    uv run tax-download

    This will guide you through login and automatically download all required files (ESPP history, Orders, and RSU confirmations).

    Alternatively, you can run individual tasks:

    uv run tax-login
    uv run tax-download-espp
    uv run tax-download-orders
    uv run tax-download-rsu

4. Run Analysis

Once your data is in the input/ directory:

uv run main.py

It will generate a pdf file tax_report_*.pdf

Filing in FinanzOnline

The tax report output includes the values you need for your Austrian tax return (Formulars E1 / E1kv):

Kennzahl Description Value to enter
994 Realized gains from capital assets (Einkünfte aus Kapitalvermögen) Total gains for the year
892 Realized losses from capital assets (Verluste aus Kapitalvermögen) Total losses for the year (as a negative number)

These Kennzahlen are shown in both the console output and the generated PDF report.

How It Works

For a detailed explanation of the tax calculation methodology, including the moving average cost basis formula, currency conversion, and practical examples, see the Tax Calculation Method documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages