This is a modified and adapted version of the otiginal opensteuerauszug by vroonhof vroonhof/opensteuerauszug
Main changes:
- import all broker payments and tax values
- support for bonds and bond accrued interest (not taxable in Switzerland)
- option to remove all securities without value at the start end end of tax period and without any taxable payments
- summarize by currency for easy comparison with IBKR statements
- etc.
A Python package for generating Swiss tax statements (Steuerauszüge) from the statements of brokers that don't support it, e.g. mostly foreign ones. This goal is to eliminate tedious and error prone manual typing into the tax software.
- The package is not formally audited
- the main focus is on getting core transaction and interest data.
- These need to be verified by the user before submitting with the tax return
- Tax values are computed best effort for informational purpose (the main Tax software should be able to compute it from the core transaction data.
For more information on required due diligence see the the user guide.
After installing, use the User Guide as the main walkthrough. It covers quick start, preparation steps, broker data export, and complete command examples.
The tool can also be used to cross check and existing existing Steuerauszug (eCH-0196 XML). See See verify instructions.
You can attach original broker statements or other supporting documents to the generated PDF using --pre-amble and --post-amble options. See the User Guide for details.
- Import broker data provide transaction and position data in ECH-0196 compliant format.
- Perform simple tax approximations for informational purposes.
- Cross verify calculations against existing E-Steuerauszug data
- Create standardized formatted PDF that can be imported into Tax Software.
- Append original supporting documents to the final PDF.
Below are previews from a sample Steuerauszug generated from the VT and Chill IBKR test data.
| Summary page (p.1) | Stock table (p.3) |
|---|---|
![]() |
![]() |
📄 Download full sample ECH-0196 XML
For now the focus is on brokers / banks that the author has
- Charles Schwab (main trading account and Equity Awards)
- Interactive Brokers
Additionally we can recalculate and verify any existing steuerauszug (this is mostly to increase confidence in the software itself)
Datalevel offers a very similar solution for IBKR as a paid service (reasonable yearly flat fee). It is a SaaS solution that requires online access to the flex API for your account. They are from the Swiss banking ecosystem so they use the shared Java rendering libraries which makes things look a bit more standard. They suffer from of the same issues as well, like this project they are not actually the official bank. If you need no hassle, this could be it.
zh-tax-csv-import is a chrome extension also imports Schwab and Interactive Broker statements, but then fills in directly on the tax forms. This is less clean and more brittle, but once done the Tax office sees no difference to manual entry. As an upside the tax declaration remains an authoritative list of all your investments and accounts.
Agentic browsers are getting very close just be able to do the above all by themselves.
The EWV and SSK publish a shared set of tools that is even referenced in the spec. This used to available online, but is now locked down to a cabal of banks and tax officials. Inquiring minds however have noticed that the JAR is included in nearly every offline official Tax software. It includes an official sample renderer for the PDF version given an XML file, so you could also use that instead of the python renderer. It will look a bit more official. I wasn't aware this existed and had to reconstruct from scratch as well as fix a lot of the python PDF417 libraries. The spec refers to the library as open source but non of these actually include the source.
uv tool install --from git+https://github.com/vroonhof/opensteuerauszug.git opensteuerauszug
# Then run normally (without pixi, or after . ./scripts/setup_pixi.sh)
opensteuerauszug --helpInstall uv first: https://docs.astral.sh/uv/getting-started/installation/
uv can also install/manage Python for you, so you usually do not need a
separate Python setup step.
For one-off runs without installing the tool, you can also use:
uv run --with git+https://github.com/vroonhof/opensteuerauszug.git opensteuerauszug --helpThen continue with the User Guide.
For development and tests, install from source:
git clone https://github.com/vroonhof/opensteuerauszug.git
cd opensteuerauszug
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pip install git+https://github.com/vroonhof/pdf417decoder.git#subdirectory=pythonDevelopment install [option 2] (contributors: using pixi)
git clone https://github.com/vroonhof/opensteuerauszug.git
cd opensteuerauszug
. ./scripts/setup_pixi.shWhen you export the final XML using --xml-output, you can validate it
against the official eCH-0196 schema with common XML tools. Examples:
# Using libxml2
xmllint --noout --schema specs/eCH-0196-2-2.xsd output.xml
# Using a Java based validator (Jing)
java -jar jing.jar specs/eCH-0196-2-2.xsd output.xmlThis project includes various scripts for data processing, testing, and utility tasks. For detailed documentation on available scripts, including the Kursliste filtering tool, see the Scripts Readme.
To set up the development environment (venv):
# Create and activate virtual environment
python -m venv .venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -e ".[dev]"To set up the development environment (pixi):
. ./setup_pixi.shpytest tests/If the environment variable EXTRA_SAMPLE_DIR points to a directory with XML files these are validated as part of a set of integration sets. See the verify documentation for how to invoke that manually.
This project includes utility scripts for development and data management. For detailed information on these scripts, please see the Scripts Documentation.
This project exists in part for me to try out AI based coding outside of $WORKPLACE to try out various tools. As a result code quality and style is inconsistent and contains various AIisms. Code has been cleaned-up, reviewed and controlled by me where it matters.
That said all mistakes, hallucinations etc are probably mine.
- https://github.com/stefanloerwald/zh-tax-csv-import : if you want an automated import that controls PrivateTax directly. It is more hacky but leaves no trace for the tax office to be confused about.
- https://github.com/BrunoEberhard/open-ech-taxstatement : An old project I only discovered later that contains a model defintion of the Tax data targeting Java. The author has since left the Swis open data efforts.
- https://github.com/KapJI/capital-gains-calculator : UK Capital Gains Tax calculator supporting Charles Schwab, Interactive Brokers, and others. Thanks to @KapJI and contributors for the comprehensive Schwab transaction type coverage and sample data that helped improve our importer. Their test data serves as a useful source of example inputs for many importers.
Many thanks to everyone who has tested this tool with their own data and contributed fixes and improvements.
Special thanks to @pet-zh, whose extensive real-world testing and numerous fixes have made the output significantly more polished and reliable.
See LICENSE file.
Though I am not formally requiring it to keep things simple, I would prefer if you dropped me a line if this package being used or included in other software or other service (e.g. if you are financial service provider).

