Skip to main content

vatvalidate is a Python library for validating UK VAT numbers.

Project description

vatvalidate

Ever wondered if that VAT number is valid? Well, now you can find out thanks to this simple Python library.

vatvalidate implements the modulus 97 and modulus 9755 used to check the validity of VAT numbers in the United Kingdom. For more info on these algorithms, see this link.

Installation

To install vatvalidate, simply:

$ pip install vatvalidate

Usage

Using validate_vat_number, you can simply check the validity of vat number strings.

from vatvalidate.validate import validate_vat_number

# Validate a vat number using validate_vat_number
vat_numbers = [
    "GB424807302",
    "424807302",
    "VAT NUMBER: 424807302",
    "GB279238956",
    "1234",
]

print(
    [validate_vat_number(number) for number in vat_numbers]
)
#> [True, True, True, False, False]

Project details


Download files

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

Source Distribution

vatvalidate-0.0.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

vatvalidate-0.0.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page