Offline VAT rates and validation for 44 countries — EU-27, UK, Switzerland, Norway, and more. Real checksum validation, not just regex.
Project description
vatverify-rates
Offline VAT number validation and VAT rates for 44 countries. Real checksum algorithms (MOD97, MOD11, Luhn, HMRC 97-55), not just regex. Zero runtime dependencies, pure Python, fully type-annotated.
For live validation (VIES / HMRC / CH UID / Brønnøysund), use this package as the format/checksum pre-check in front of the hosted vatverify API.
Install
pip install vatverify-rates
Usage
Look up a rate
from vatverify_rates import get_standard_rate, get_rate
get_standard_rate("DE") # 19.0
get_standard_rate("FR") # 20.0
rate = get_rate("DE")
# Rate(country_code='DE', country='Germany', standard=19.0, reduced=(7.0,), ...)
Validate a VAT number
from vatverify_rates import validate
result = validate("IE6388047V")
if result.valid:
print("valid")
else:
print("invalid:", result.errors)
Country utilities
from vatverify_rates import country_name, is_eu_member, get_flag
country_name("DE") # 'Germany'
is_eu_member("CH") # False
is_eu_member("DE") # True
get_flag("FR") # '🇫🇷'
Types
from vatverify_rates import Rate, ValidateResult, CountryCode
Rate and ValidateResult are @dataclass(frozen=True, slots=True). CountryCode and EUMemberCode are Literal unions of ISO-2 codes.
API
| Function | Returns |
|---|---|
get_rate(code) |
Rate | None |
get_standard_rate(code) |
float | None |
get_all_rates() |
dict[str, Rate] |
country_name(code) |
str | None |
country_name_local(code) |
str | None |
is_eu_member(code) |
bool |
is_known_country(code) |
bool |
get_flag(code) |
str (emoji or "") |
validate_format(vat, country=None) |
bool |
validate_checksum(vat, country=None) |
bool |
validate(vat, country=None) |
ValidateResult |
data_version |
str (ISO date of latest refresh) |
Supported countries
| Group | Codes |
|---|---|
| EU-27 | AT, BE, BG, CY, CZ, DE, DK, EE, EL, ES, FI, FR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK |
| UK & protocol | GB, XI |
| EFTA | CH, LI, NO, IS |
| Micro-states | AD |
| Candidate / other | AL, BA, ME, MK, RS, TR, MD, UA, XK, GE |
Greece uses EL per VIES convention. XI is Northern Ireland under the Brexit protocol.
Offline vs live
Offline checks (format + checksum) catch typos and fraudulent-looking numbers, but cannot confirm a number is registered with a tax authority. That requires a live registry call. The hosted vatverify API handles VIES, HMRC, BFS, and Brønnøysund, with freshness-aware responses so a registry outage never breaks your checkout.
Other languages
Same data, same functions, idiomatic per language:
- JavaScript / TypeScript:
@vatverify/vat-rates(source: vat-rates-js)
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
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 vatverify_rates-0.1.0.tar.gz.
File metadata
- Download URL: vatverify_rates-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31d5e1d7a2801ff55a5a158b52de8a3f0176ea828691daddda279ea14b1dec8
|
|
| MD5 |
64608579e487068fb54ae3c509c54b0e
|
|
| BLAKE2b-256 |
75f97fef0687d4a776e06129187beca322e0b541125c6cfbaaee27d9b5a1e60d
|
Provenance
The following attestation bundles were made for vatverify_rates-0.1.0.tar.gz:
Publisher:
publish.yml on vatverify/vat-rates-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vatverify_rates-0.1.0.tar.gz -
Subject digest:
c31d5e1d7a2801ff55a5a158b52de8a3f0176ea828691daddda279ea14b1dec8 - Sigstore transparency entry: 1367812594
- Sigstore integration time:
-
Permalink:
vatverify/vat-rates-py@a8b077c20092b5fefa1d2b7e747d3009bdd94433 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vatverify
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a8b077c20092b5fefa1d2b7e747d3009bdd94433 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vatverify_rates-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vatverify_rates-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
991791ea4d17f65050e5891d0972766cc51c33d8e6652db7c3f2cc3e33e1770c
|
|
| MD5 |
d941722257ea9b091a0e7623bd684579
|
|
| BLAKE2b-256 |
dd5f46df03ede94eb424e5f328f0f47637704280d5dba32d97d2a9377188ba7b
|
Provenance
The following attestation bundles were made for vatverify_rates-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on vatverify/vat-rates-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vatverify_rates-0.1.0-py3-none-any.whl -
Subject digest:
991791ea4d17f65050e5891d0972766cc51c33d8e6652db7c3f2cc3e33e1770c - Sigstore transparency entry: 1367812610
- Sigstore integration time:
-
Permalink:
vatverify/vat-rates-py@a8b077c20092b5fefa1d2b7e747d3009bdd94433 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vatverify
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a8b077c20092b5fefa1d2b7e747d3009bdd94433 -
Trigger Event:
workflow_dispatch
-
Statement type: