Skip to content

Validate VAT IDs, fetch current rates, and calculate the correct VAT – all with three endpoints. Fast, simple, reliable.

License

Notifications You must be signed in to change notification settings

vatifytax/vatify-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vatify – Official Python SDK

EU VAT validation, rates, and calculation with one API.

PyPI version Python License: MIT


Install

pip install vatify

Set your API Key

export VATIFY_API_KEY="your_api_key"

Quickstart (sync)

from vatify import Vatify

client = Vatify(api_key="YOUR_API_KEY")

# 1) Validate VAT number
res = client.validate_vat("DE123456789")
print(res.valid, res.country_code, res.name)

# 2) Calculate VAT rate (by country, type, date)
res = client.calculate(amount=100, basis="net", rate_type="reduced", supply_date=str(date.today().isoformat()),
                           supplier={"country_code": "DE", "vat_number": "DE811907980"},
                           customer={"country_code": "FR", "vat_number": "FR40303265045"},
                           supply_type="services", b2x="B2B", category_hint="ACCOMMODATION")
print(res)

# 3) Get rates for a country
rates = client.rates("DE")
print(rates)
client.close()

Quickstart (async)

import asyncio
from vatify import VatifyAsync

async def main():
    client = VatifyAsync(api_key="YOUR_API_KEY")
    res = await client.validate_vat("DE123456789")
    print(res.valid)
    await client.aclose()

asyncio.run(main())

Quickstart (cli)

vatify validate DE123456789
vatify rates DE

Error Handling

All API/network issues raise VatifyError with optional status_code and details.

from vatify import Vatify, VatifyError

try:
    Vatify(api_key="x").validate_vat("DE123")
except VatifyError as e:
    print("Failed:", e, e.status_code)

Contributing

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"  # (optional if you add dev deps)
pytest -q

Build and upload

pipx run build
python -m pip install --upgrade build twine
python -m build
twine upload dist/*

About

Validate VAT IDs, fetch current rates, and calculate the correct VAT – all with three endpoints. Fast, simple, reliable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published