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
- Live API (key-free):
https://claracars.pt/api/public/isv?cc=1950&co2=130&fuel=diesel&year=2016— returns both ISV and IUC. - JS/TS SDK:
portugal-vehicle-taxon npm - PHP SDK:
claracars/portugal-vehicle-taxon Packagist - MCP server: claracarspt/mcp
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e89679d44bf05cbd9035dbf29b82536b8678d5fd1d4b1464d93da46d913633d5
|
|
| MD5 |
cc1aea4087cf89dfd83d333121b375bf
|
|
| BLAKE2b-256 |
96b00d900640824fa725205f3f423d7af63c98d152d0daaf63a2996eda858823
|
File details
Details for the file portugal_vehicle_tax-1.0.0-py3-none-any.whl.
File metadata
- Download URL: portugal_vehicle_tax-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51b7480f605642e3470da6d13e835ed13562d632db0aa95f6d8ab08d4b8a46ec
|
|
| MD5 |
2aad6caec0e97a861a667f746557f122
|
|
| BLAKE2b-256 |
4a356f636dbc62f1a2f09f21c60bb1cb58177dee2b0b6bf39dd6a083a63d00a8
|