Calculator Module
The main calculator module for computing income tax.
- class taxcalcindia.calculator.IncomeTaxCalculator(settings, salary=None, capital_gains=None, business=None, other_income=None, deductions=None)[source]
Bases:
objectIncome Tax Calculator for individuals.
- Parameters:
settings (TaxSettings)
salary (SalaryIncome | None)
capital_gains (CapitalGainsIncome | None)
business (BusinessIncome | None)
other_income (OtherIncome | None)
deductions (Deductions | None)
- __init__(settings, salary=None, capital_gains=None, business=None, other_income=None, deductions=None)[source]
Income Tax Calculator for individuals.
- Parameters:
settings (TaxSettings)
salary (SalaryIncome | None)
capital_gains (CapitalGainsIncome | None)
business (BusinessIncome | None)
other_income (OtherIncome | None)
deductions (Deductions | None)
- property gross_income
Calculate the gross income from all sources.
- Returns:
The total gross income.
- Return type:
float
- property total_deductions
Calculate the total deductions for the individual.
- calculate_tax(is_comparision_needed=True, is_tax_per_slab_needed=False, display_result=False)[source]
Calculate tax based on the individual’s income and deductions.
- Parameters:
is_comparision_needed (bool, optional) – Whether to include tax regime comparison. Defaults to True.
is_tax_per_slab_needed (bool, optional) – Whether to include tax per slab details. Defaults to False.
display_result (bool)
- Returns:
A dictionary containing the tax calculation results.
- Return type:
dict
- property new_regime_tax: int
Calculates the total tax payable under the new tax regime.
- Returns:
Total tax payable under the new tax regime.
- Return type:
int
- property old_regime_tax: int
Calculates the total tax payable under the old tax regime.
- Returns:
Total tax payable under the old tax regime.
- Return type:
int
- property new_regime_taxable_income: float
Calculates the taxable income under the new tax regime.
- Returns:
Taxable income under the new tax regime.
- Return type:
float
- property old_regime_taxable_income: float
Calculates the taxable income under the old tax regime.
- Returns:
Taxable income under the old tax regime.
- Return type:
float
- property recommended_regime: str
Calculates the recommended tax regime based on the user’s income and deductions.
- Returns:
Recommended tax regime (“new” or “old”).
- Return type:
str
- property tax_savings: int
Calculates the tax savings by comparing the new and old tax regimes.
- Returns:
Tax savings amount.
- Return type:
int
- property new_regime_breakup: dict
Calculates the tax breakup under the new tax regime.
- Returns:
Tax breakup under the new tax regime.
- Return type:
dict
- property old_regime_breakup: dict
Calculates the tax breakup under the old tax regime.
- Returns:
Tax breakup under the old tax regime.
- Return type:
dict
- tax_per_slab(regime='new')[source]
Calculates the tax per slab under the specified tax regime.
- Parameters:
regime (str, optional) – The tax regime (“new” or “old”). Defaults to “new”.
- Raises:
ValueError – If the regime is not “new” or “old”.
- Returns:
Tax per slab under the specified tax regime.
- Return type:
dict