Skip to main content

portugal-vehicle-tax

Portuguese vehicle-tax calculators — ISV (Imposto Sobre Veículos, the one-off import/registration tax) and IUC (Imposto Único de Circulação, the annual road tax) — as a zero-dependency, pure-Python library.

Maintained by Clara Cars and used in production behind the public API at https://claracars.pt/api/public. Source: claracarspt/calcs.

A maintained estimate, cross-checked against the official AT simulator; not the official AT figure. These calculators are periodically verified against the Autoridade Tributária (AT) simulator and public tax tables — they are not the official AT number and not a substitute for the AT simulator or a licensed despachante. Tax tables change every year; verify before you rely on a euro amount.

Install

pip install portugal-vehicle-tax

Requires Python 3.10+. No runtime dependencies.

Usage

from portugal_vehicle_tax import isv, iuc

# ISV — 2016 diesel, 1950 cc, 130 g/km CO2, 10.2 years old, used EU import
r = isv.compute_isv("passenger", cc=1950, co2=130, fuel="diesel",
                    age_years=10.2, year=2016, from_eu=True, used=True)
print(r["isv"])          # 1832.92
print(r["breakdown"])    # itemised like the official AT "Demonstração"

# IUC — annual road tax for the same car
print(iuc.compute(cc=1950, co2=130, fuel="diesel", year=2016)["iuc"])   # 278.85

# Electric → exempt from both
isv.compute_isv("passenger", fuel="electric")   # {'isv': 0.0, 'exempt': True, ...}

ISV — isv.compute_isv(category, cc, co2, fuel, age_years, year, ...)

Arg Notes
category passenger | autocaravana | motorcycle | van_10 | commercial_15/50/100 | pesados_mercadorias | pesados_passageiros
cc Engine displacement (cm³)
co2 CO₂ g/km (WLTP/NEDC auto-selected by year)
fuel petrol | diesel | electric | phev | hybrid | lpg
age_years Years since first registration (drives the Tabela D reduction)
year First-registration year (NEDC/WLTP + PHEV cap + classic flags)
from_eu, used EU import + used → age reduction eligible
phev_range_km PHEV needs ≥50 km (+ low CO₂) for the 75% reduction

Returns a dict with isv, exempt, table, breakdown (line-by-line AT demonstração), age_reduction_pct, and a note where a caveat applies.

IUC — iuc.compute(cc, co2, fuel, year, vehicle_type="passenger")

Categoria B (cars ≥2007, cc+CO₂), Categoria A (<2007, cc × year-band), Categoria E (motorcycles). For goods vehicles use iuc.compute_iuc(vehicle_type, cc, co2, fuel, year, peso_bruto=...) (Categorias C/D, by gross weight).

Correctness self-check

python -m pytest -q          # or: python tests/test_calc.py

Ships a golden case table (petrol, diesel with age reduction, electric-exempt, the €100 minimum, PHEV reduction) frozen against the canonical Clara Cars logic. Any drift fails.

Related

MIT © Clara Cars

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portugal_vehicle_tax-1.0.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

portugal_vehicle_tax-1.0.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file portugal_vehicle_tax-1.0.0.tar.gz.

File metadata

  • Download URL: portugal_vehicle_tax-1.0.0.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for portugal_vehicle_tax-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e89679d44bf05cbd9035dbf29b82536b8678d5fd1d4b1464d93da46d913633d5
MD5 cc1aea4087cf89dfd83d333121b375bf
BLAKE2b-256 96b00d900640824fa725205f3f423d7af63c98d152d0daaf63a2996eda858823

See more details on using hashes here.

File details

Details for the file portugal_vehicle_tax-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for portugal_vehicle_tax-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51b7480f605642e3470da6d13e835ed13562d632db0aa95f6d8ab08d4b8a46ec
MD5 2aad6caec0e97a861a667f746557f122
BLAKE2b-256 4a356f636dbc62f1a2f09f21c60bb1cb58177dee2b0b6bf39dd6a083a63d00a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page