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 TransparentCars and used in production behind the public
API at https://transparent.pt/api/public. Source: transparentpt/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 TransparentCars logic. Any drift fails.
Related
- Live API (key-free):
https://transparent.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:
transparentpt/portugal-vehicle-taxon Packagist - MCP server: transparentpt/mcp
MIT © TransparentCars
Metadata
Release files for portugal-vehicle-tax 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| portugal_vehicle_tax-1.0.1.tar.gz | 24.4 kB | Without provenance | Details for portugal_vehicle_tax-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| portugal_vehicle_tax-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for portugal_vehicle_tax-1.0.1-py3-none-any.whl |
Total release size: 47.7 kB
Release files / portugal_vehicle_tax-1.0.1.tar.gz
| Download URL | portugal_vehicle_tax-1.0.1.tar.gz |
|---|---|
| Size | 24.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8d0e9789b5f88163c24346600fc927ef33b5003f4785249bd0b9ffc11417859
|
|
BLAKE2b-256 checksum How to use checksums |
4de57e237647b60545c939f726c4107724c64b407c82b2ab0eec06df242abbb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / portugal_vehicle_tax-1.0.1-py3-none-any.whl
| Download URL | portugal_vehicle_tax-1.0.1-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a17596d61aca31e4fc9303ba60f5d4ea83e590c1a215016240b55df9137f287a
|
|
BLAKE2b-256 checksum How to use checksums |
6de38b4d5d66dc48e3bf33b836bf2a2af6966d97d6ddbe27c55981869fb54413
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for portugal-vehicle-tax 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.