netto ===== .. py:module:: netto Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/netto/config/index /autoapi/netto/data_loader/index /autoapi/netto/main/index /autoapi/netto/social_security/index /autoapi/netto/taxes_income/index /autoapi/netto/taxes_other/index Classes ------- .. autoapisummary:: netto.TaxConfig Functions --------- .. autoapisummary:: netto.calc_inverse_netto netto.calc_netto netto.calc_deductible_social_security netto.calc_insurance_health netto.calc_insurance_nursing netto.calc_insurance_pension netto.calc_insurance_unemployment netto.calc_social_security netto.calc_social_security_by_integration netto.get_rate_health netto.get_rate_nursing netto.get_rate_pension netto.get_rate_unemployment netto.calc_income_tax netto.calc_income_tax_by_integration netto.calc_taxable_income netto.get_marginal_tax_rate netto.calc_church_tax netto.calc_soli Package Contents ---------------- .. py:class:: TaxConfig Configuration for tax and social security calculations. :param year: Tax year (2018-2026, default: 2025) :type year: int :param has_children: Has children (affects nursing insurance) :type has_children: bool :param is_married: Married status (doubles tax brackets) :type is_married: bool :param extra_health_insurance: Extra health insurance rate :type extra_health_insurance: float :param church_tax: Church tax rate (set to 0.0 for none) :type church_tax: float .. rubric:: Examples >>> TaxConfig() >>> TaxConfig(year=2025, is_married=True, has_children=True) >>> TaxConfig(church_tax=0.0) .. py:attribute:: year :type: int :value: 2025 .. py:attribute:: has_children :type: bool :value: False .. py:attribute:: is_married :type: bool :value: False .. py:attribute:: extra_health_insurance :type: float :value: 0.025 .. py:attribute:: church_tax :type: float :value: 0.09 .. py:method:: __post_init__() Validate configuration values. .. py:function:: calc_inverse_netto(desired_netto: float, deductibles: float = 0, config: netto.config.TaxConfig | None = None) -> float Calculate required gross salary to reach desired net income. :param desired_netto: Desired net income :type desired_netto: float :param deductibles: Additional deductibles that reduce taxable income :type deductibles: float, optional :param config: Tax configuration (uses defaults if not provided) :type config: TaxConfig, optional :returns: Required gross salary :rtype: float .. rubric:: Examples >>> calc_inverse_netto(50000) >>> calc_inverse_netto(50000, deductibles=5000) >>> config = TaxConfig(year=2025, is_married=True) >>> calc_inverse_netto(50000, config=config) .. py:function:: calc_netto(salary: float, deductibles: float = 0, verbose: bool = False, config: netto.config.TaxConfig | None = None) -> float Calculate net income from gross salary. :param salary: Yearly gross salary :type salary: float :param deductibles: Additional deductibles that reduce taxable income :type deductibles: float, optional :param verbose: Print detailed calculation breakdown :type verbose: bool, optional :param config: Tax configuration (uses defaults if not provided) :type config: TaxConfig, optional :returns: Net income :rtype: float .. rubric:: 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) .. py:function:: calc_deductible_social_security(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_insurance_health(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_insurance_nursing(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_insurance_pension(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_insurance_unemployment(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_social_security(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_social_security_by_integration(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: get_rate_health(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: get_rate_nursing(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: get_rate_pension(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: get_rate_unemployment(salary: float, config: netto.config.TaxConfig | None = None) -> float .. py:function:: calc_income_tax(taxable_income: float, config: netto.config.TaxConfig | None = None) -> float Calculate the income tax for a given taxable income. :param taxable_income: The taxable income for which the income tax should be calculated. :type taxable_income: float or int :param config: Tax configuration (uses default if not provided) :type config: TaxConfig, optional :returns: **income_tax** -- The income tax for the given taxable income. :rtype: float .. rubric:: Examples # Calculate income tax for a taxable income of 10000 calc_income_tax(10000) .. py:function:: calc_income_tax_by_integration(taxable_income: float, config: netto.config.TaxConfig | None = None) -> float Calculate income tax by numerical integration of marginal tax rates. :param taxable_income: Taxable income :type taxable_income: float :param config: Tax configuration (uses defaults if not provided) :type config: TaxConfig, optional :returns: Income tax amount :rtype: float .. rubric:: Examples >>> calc_income_tax_by_integration(10000) .. py:function:: calc_taxable_income(salary: float, deductible_social_security: float, deductibles_other: float = 0) -> float Calculate the taxable income for a given salary and deductibles. :param salary: The yearly salary for which the taxable income should be calculated. :type salary: float or int :param deductible_social_security: The amount of deductible social security contributions. :type deductible_social_security: float or int :param deductibles_other: Other deductibles that reduce the taxable income (default is 0). :type deductibles_other: float or int, optional :returns: **taxable_income** -- The taxable income for the given salary and deductibles. :rtype: float .. rubric:: 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) .. py:function:: get_marginal_tax_rate(taxable_income: float, config: netto.config.TaxConfig | None = None) -> float Calculate the marginal tax rate for a given taxable income. :param taxable_income: The taxable income for which the marginal tax rate should be calculated. :type taxable_income: float or int :param config: Tax configuration (uses default if not provided) :type config: TaxConfig, optional :returns: **marginal_tax_rate** -- The marginal tax rate for the given taxable income. :rtype: float .. rubric:: Examples # Calculate marginal tax rate for a taxable income of 10000 get_marginal_tax_rate(10000) .. py:function:: calc_church_tax(tax_assessment: float, config: netto.config.TaxConfig | None = None) -> float Calculate church tax (Kirchensteuer). :param tax_assessment: The income tax assessment base :type tax_assessment: float :param config: Tax configuration (uses default if not provided) :type config: TaxConfig, optional :returns: The church tax amount :rtype: float .. py:function:: calc_soli(tax_assessment: float, config: netto.config.TaxConfig | None = None) -> float Calculate solidarity tax (Solidaritätszuschlag). :param tax_assessment: The income tax assessment base :type tax_assessment: float :param config: Tax configuration (uses default if not provided) :type config: TaxConfig, optional :returns: The solidarity tax amount :rtype: float