Skip to content

devbrains-com/swisstaxcalculator

Repository files navigation

🇨🇭 Swiss Tax Calculator

The goal of this repository is to implement all the logic used to calculate the swiss taxes and serve it in a super fast service to do any kind of calculations in any kind of environment.


👋 Get started

  • Clone the repository
  • yarn install (installs all the depencencies)
  • yarn dev (runs the dev server)

👉 Functionality


Supported tax types

  • Income & wealth (fortune)
  • (Pension) capital withdrawal

Supported income types

  • Taxable income
  • Net income
  • Gross income

The speciality about the gross- and net-income types is the deductions that are made automatically based on the tax input and the possible deductions.


ℹ️ Data source

Tarifs, Factors and Deductions

https://swisstaxcalculator.estv.admin.ch/#/taxdata

(Pension) capital widhdrawal defintions

Some information is from https://finpension.ch/de/vergleich-kapitalbezugssteuer/ and the updated values are from the individual canton tax laws directly.


🔥 Static deployment support

To run the service, there is no database required. All the data is either in the code files or imported from the raw data during dev / build time using the following command.

yarn importdata <year>

Raw data: ./data/raw/...
Parsed data: ./data/parsed/...

To import more tax years, just copy the raw files into the corresponding folder and run the importdata script.


🚀 Blazing fast execution

The data is parsed into small chunks, mostly per canton to guarante a fast loading time and minimal memory consumption. Once loaded, the data is held in memory until the service is stopped.

In an always on environment, the data will be in memory until redeployed. This ensures maximum execution speed.

For cloud functions, the data has to be reloaded once the function was removed and reloaded into memory.


🤝 Contribution & Usage

For issues and questions, please create an issue.

Please contact me (michael.bolliger@gmail.com) if you want to contribute or use this repository in your own environment or application. Thank you.