netto
Submodules
Classes
Configuration for tax and social security calculations. |
Functions
|
Calculate required gross salary to reach desired net income. |
|
Calculate net income from gross salary. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calculate the income tax for a given taxable income. |
|
Calculate income tax by numerical integration of marginal tax rates. |
|
Calculate the taxable income for a given salary and deductibles. |
|
Calculate the marginal tax rate for a given taxable income. |
|
Calculate church tax (Kirchensteuer). |
|
Calculate solidarity tax (Solidaritätszuschlag). |
Package Contents
- class netto.TaxConfig[source]
Configuration for tax and social security calculations.
- Parameters:
year (int) – Tax year (2018-2026, default: 2025)
has_children (bool) – Has children (affects nursing insurance)
is_married (bool) – Married status (doubles tax brackets)
extra_health_insurance (float) – Extra health insurance rate
church_tax (float) – Church tax rate (set to 0.0 for none)
Examples
>>> TaxConfig() >>> TaxConfig(year=2025, is_married=True, has_children=True) >>> TaxConfig(church_tax=0.0)
- year: int = 2025
- has_children: bool = False
- is_married: bool = False
- extra_health_insurance: float = 0.025
- church_tax: float = 0.09
- netto.calc_inverse_netto(desired_netto: float, deductibles: float = 0, config: netto.config.TaxConfig | None = None) float[source]
Calculate required gross salary to reach desired net income.
- Parameters:
desired_netto (float) – Desired net income
deductibles (float, optional) – Additional deductibles that reduce taxable income
config (TaxConfig, optional) – Tax configuration (uses defaults if not provided)
- Returns:
Required gross salary
- Return type:
float
Examples
>>> calc_inverse_netto(50000) >>> calc_inverse_netto(50000, deductibles=5000) >>> config = TaxConfig(year=2025, is_married=True) >>> calc_inverse_netto(50000, config=config)
- netto.calc_netto(salary: float, deductibles: float = 0, verbose: bool = False, config: netto.config.TaxConfig | None = None) float[source]
Calculate net income from gross salary.
- Parameters:
salary (float) – Yearly gross salary
deductibles (float, optional) – Additional deductibles that reduce taxable income
verbose (bool, optional) – Print detailed calculation breakdown
config (TaxConfig, optional) – Tax configuration (uses defaults if not provided)
- Returns:
Net income
- Return type:
float
Examples
>>> calc_netto(50000) >>> calc_netto(50000, deductibles=10000) >>> calc_netto(50000, verbose=True) >>> config = TaxConfig(year=2025, is_married=True) >>> calc_netto(50000, config=config)
- netto.calc_deductible_social_security(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_insurance_health(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_insurance_nursing(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_insurance_pension(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_insurance_unemployment(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_social_security(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_social_security_by_integration(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.get_rate_health(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.get_rate_nursing(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.get_rate_pension(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.get_rate_unemployment(salary: float, config: netto.config.TaxConfig | None = None) float[source]
- netto.calc_income_tax(taxable_income: float, config: netto.config.TaxConfig | None = None) float[source]
Calculate the income tax for a given taxable income.
- Parameters:
taxable_income (float or int) – The taxable income for which the income tax should be calculated.
config (TaxConfig, optional) – Tax configuration (uses default if not provided)
- Returns:
income_tax – The income tax for the given taxable income.
- Return type:
float
Examples
# Calculate income tax for a taxable income of 10000 calc_income_tax(10000)
- netto.calc_income_tax_by_integration(taxable_income: float, config: netto.config.TaxConfig | None = None) float[source]
Calculate income tax by numerical integration of marginal tax rates.
- Parameters:
taxable_income (float) – Taxable income
config (TaxConfig, optional) – Tax configuration (uses defaults if not provided)
- Returns:
Income tax amount
- Return type:
float
Examples
>>> calc_income_tax_by_integration(10000)
- netto.calc_taxable_income(salary: float, deductible_social_security: float, deductibles_other: float = 0) float[source]
Calculate the taxable income for a given salary and deductibles.
- Parameters:
salary (float or int) – The yearly salary for which the taxable income should be calculated.
deductible_social_security (float or int) – The amount of deductible social security contributions.
deductibles_other (float or int, optional) – Other deductibles that reduce the taxable income (default is 0).
- Returns:
taxable_income – The taxable income for the given salary and deductibles.
- Return type:
float
Examples
# Calculate taxable income for a salary of 50000 with deductible social security contributions of 1000 and no other deductibles calc_taxable_income(50000, 1000)
# Calculate taxable income for a salary of 60000 with deductible social security contributions of 2000 and other deductibles of 500 calc_taxable_income(60000, 2000, 500)
- netto.get_marginal_tax_rate(taxable_income: float, config: netto.config.TaxConfig | None = None) float[source]
Calculate the marginal tax rate for a given taxable income.
- Parameters:
taxable_income (float or int) – The taxable income for which the marginal tax rate should be calculated.
config (TaxConfig, optional) – Tax configuration (uses default if not provided)
- Returns:
marginal_tax_rate – The marginal tax rate for the given taxable income.
- Return type:
float
Examples
# Calculate marginal tax rate for a taxable income of 10000 get_marginal_tax_rate(10000)
- netto.calc_church_tax(tax_assessment: float, config: netto.config.TaxConfig | None = None) float[source]
Calculate church tax (Kirchensteuer).
- Parameters:
tax_assessment (float) – The income tax assessment base
config (TaxConfig, optional) – Tax configuration (uses default if not provided)
- Returns:
The church tax amount
- Return type:
float
- netto.calc_soli(tax_assessment: float, config: netto.config.TaxConfig | None = None) float[source]
Calculate solidarity tax (Solidaritätszuschlag).
- Parameters:
tax_assessment (float) – The income tax assessment base
config (TaxConfig, optional) – Tax configuration (uses default if not provided)
- Returns:
The solidarity tax amount
- Return type:
float