Skip to main content

vat-validator

Pythonic VAT validation library 🌍💳✅

Build status Documentation Status Coverage status Code style: black License: MIT PyPI

Features

  • Offline VAT code validation using country specific regular expressions and checksum algorithms;

  • Online validation for European Union VAT codes using VIES webservice;

  • VAT code sanitization;

  • Fully annotated with type hints, for a better IDE and mypy development experience;

  • Tested and validated against 1697 different VAT codes.

Getting started

Instalation

vat-validator is distributed as standard pip library, and can be installed by running:

pip install vat-validator

To install the latest development version directly from git:

pip install git+git://github.com/ajcerejeira/vat-validator.git

Usage

>>> from vat_validator import validate_vat, countries_where_vat_is_valid
>>> validate_vat('PT', 'PT 502 011 378')
True
>>> countries_where_vat_is_valid('502 011 378')
['PT']
>>> from vat_validator.vies import check_vat
>>> check_vat('PT', '502 011 378')
CheckVATResult(country_code='PT', vat='502011378', request_date=datetime.date(2019, 6, 8), valid=True, name='UNIVERSIDADE DO MINHO', address='LG DO PACO\nBRAGA\n4700-320 BRAGA')

Contributing

Pull requests are welcome! Please check the CONTRIBUTING file for contribution guidelines.

License

This software is distrubuted under MIT license. See the LICENSE file for details.

Metadata

Release files for vat-validator 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vat-validator 0.1.1
File Size Uploaded
vat-validator-0.1.1.tar.gz 12.0 kB Details

Release files / vat-validator-0.1.1.tar.gz

Download URL vat-validator-0.1.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4eca6d1b6b187dd71dc980a5c8c6488b028c4c539c8c82c1fcbb3e76e0f86543
BLAKE2b-256 checksum
How to use checksums
806258a5ab401ec71da73a4004e37a356cfff0659615251ecb4815467c307d68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page