The CLI-based tool is designed to help users calculate approximate monthly net salary from their gross income in Switzerland. This tool utilizes Selenium, a web browser automation tool, to replicate user interactions with the Lohncomputer website.
This Gross Net Calculator is tailored for Swiss residents, offering detailed net salary calculations from gross income.
It employs Python and integrates libraries like click
, InquirerPy
, tabulate
, and selenium
for a seamless command-line experience.
The application uniquely utilizes Selenium to emulate user interactions with the Lohncomputer website.
- Python - The core programming language used.
- Poetry - Dependency Management and Packaging.
- Click - Creates a command-line interface.
- InquirerPy - Simplifies creating interactive CLI prompts.
- Tabulate - Formats tabular data.
- Selenium - Automates web browser interaction.
These instructions will guide you through setting up the project on your local machine for development and testing purposes.
- Python 3.11: Make sure you have Python 3.11 installed on your system.
- Firefox Browser: Required for Selenium automation. Make sure Firefox is installed on your system.
- Poetry: Used for managing dependencies. To install Poetry please refer to the official documentation.
- Clone the repository:
git clone https://github.com/loncarales/gross-net-calculator-switzerland.git
cd gross-net-calculator-switzerland
- Use Makefile for setup
The project includes a Makefile to simplify common tasks such as installing dependencies, running tests, and formatting/linting code.
To install the project dependencies, run:
make install
Run the Gross Net Calculator using the Makefile:
make run
You will be prompted to enter your gross monthly wage in CHF and your age in years. Then, you will be asked to provide additional information such as church membership, status, children, and canton of residence. The program will automate interactions with the Lohncomputer website to provide approximate net salary calculations based on the provided inputs and display the results in a tabular format.
The Makefile provides convenient commands for development and testing:
- Install Dependencies:
make install
- Run Application:
make run
- Run Tests:
make test
- Generate Coverage Report:
make coverage
- Format Code:
make format
- Lint Code:
make lint
Contributions to this project are welcome! Please feel free to report bugs, suggest features, improve documentation, or submit pull requests. Follow the standard fork-and-pull request workflow.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Special thanks to all the open-source libraries and contributors that make this project possible.
- Gratitude to the community for their valuable feedback and suggestions.