The TaxRate model is used by Athlon to compute the net costs of a vehicle.

TaxRate

Bases: BaseModel

Tax rate model.

Athlon uses tax rates to compote the (estimate) net costs of a vehicle. The API client optionally consumes the (approximate) gross yearly income of the user, and then uses it to select the correct tax rate. The tax rate is stored in the cookies, and the API will then include the net prices in its response.

Attributes:
  • label (str) –

    str The label of the tax rate. Used to extract the following information about the tax rate: - Whether loonheffingskorting is applied or not. - The lower and upper bounds of the tax rate. Extraction is done using regex. Example label: "Met loonheffingskorting jaarinkomen € 75.519 t/m € 134.929"

  • percentage (float) –

    float The percentage of the tax rate.

bounds: tuple[float, float] property

Return the lower and upper bounds of the tax rate.

If a single value v is found, return (v, inf) If no values are found, both bounds are set to 0.0 an income will never match this rate.

label: str instance-attribute

percentage: float instance-attribute

is_for_income(income, *, apply_loonheffingskorting)

Check if the tax rate is for the given income.

Parameters:
  • income (float) –

    Check whether this income is within the bounds of the rate.

  • apply_loonheffingskorting (bool) –

    Check whether the label indicates loonheffingskorting or not

Returns:
  • bool( bool ) –

    Whether the tax rate is for the given income.

TaxRates

Bases: BaseModel

Collection of tax rates.

tax_rates: list[TaxRate] instance-attribute

rate_of_income(gross_yearly_income, *, apply_loonheffingskorting)

Return the tax rate for the given income.

Parameters:
  • gross_yearly_income (float) –

    The income to get the tax rate for.

  • apply_loonheffingskorting (bool) –

    Whether to apply the loonheffingskorting.

Returns:
  • TaxRate | None

    TaxRate | None: The tax rate for the given income.

  • TaxRate | None

    None if no or multiple rates are found.