Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

VAT validation library

Project description

vat-validator

Pythonic VAT validation library 🌍💳✅

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vat-validator, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size vat-validator-0.1.0.tar.gz (11.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page