Giter Site home page Giter Site logo

ajcerejeira / vat-validator Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 91 KB

Pythonic VAT validation library

Home Page: https://vat-validator.readthedocs.io/

License: MIT License

Python 100.00%
vat vatin python3 vat-validation european-union vies eu-vat eu-vat-validator

vat-validator's Introduction

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 web service;
  • 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

Installation

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 inspect_vat, sanitize_vat, vat_is_valid
>>> vat_is_valid('PT', 'PT 502 011 378')
True
>>> sanitize_vat('PT', 'PT 502 011 378')
'502011378'

To validate a VAT number with VIES web service:

>>> 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')

Roadmap

These are the goals before the 1.0.0 release:

  • โŒ Have a comprehensive test suite with valid and invalid VAT codes for each country.
  • โŒ Compare the validity of each VAT code used in tests with TIN web service.
  • โœ… Remove zeep dependency, by using standard library urllib to make SOAP requests to VIES web service, making this a module without any dependencies.
  • โŒ Add support for async requests to VIES web service.

Contributing

Pull requests are welcome! Please check the :doc:`CONTRIBUTING <contributing>` file for contribution guidelines.

License

This software is distributed under MIT license. See the :doc:`LICENSE <license>` file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.