Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

VAT validation for Python

License

NotificationsYou must be signed in to change notification settings

oraclefinance/pyvat

 
 

Repository files navigation

https://travis-ci.org/iconfinder/pyvat.png?branch=master

With EU VAT handling rules becoming ever more ridiculous and complicated, businesses within the EU are faced with the complexity of having to validate VAT numbers.pyvat was built forIconfinder's marketplace to handle just this problem.

Validation of VAT numbers is performed in two steps: firstly, the VAT number is checked against an expression for the given country if one such is available, after which it is checked against a registry if one such is available.

Calculation of VAT rates for sales is supported within the EU for items covered by the new EU directive forVAT on telecommunications, broadcasting and electronic services.

Installation

To install requests, do yourself a favor and don't use anything other thanpip:

$ pip install pyvat

Usage

pyvat exposes its functionality through three simple methods:

pyvat.check_vat_number(vat_number, country_code=None)

Test if a VAT number is valid.

If possible, the VAT number will be checked against available registries.

Parameters:
  • vat_number -- VAT number to validate.
  • country_code -- Optional country code. Should be supplied if known, as there is no guarantee that naively entered VAT numbers contain the correct alpha-2 country code prefix for EU countries just as not all non-EU countries have a reliable country code prefix. DefaultNone prompting detection.
Returns:

True if the VAT number can be fully asserted as valid orFalse if not, otherwiseNone indicating that the VAT number may or may not be valid.

pyvat.is_vat_number_format_valid(vat_number, country_code=None)

Test if the format of a VAT number is valid.

Parameters:
  • vat_number -- VAT number to validate.
  • country_code -- Optional country code. Should be supplied if known, as there is no guarantee that naively entered VAT numbers contain the correct alpha-2 country code prefix for EU countries just as not all non-EU countries have a reliable country code prefix. DefaultNone prompting detection.
Returns:

True if the VAT number can be fully asserted as valid orFalse if not, otherwiseNone indicating that the VAT number may or may not be valid.

pyvat.get_sale_vat_charge(date, item_type, buyer, seller)

Get the VAT charge for performing the sale of an item.

Currently only supports determination of the VAT charge fortelecommunications, broadcasting and electronic services in the EU.

Parameters:
  • date (datetime.date) -- Sale date.
  • item_type (pyvat.ItemType) -- Type of the item being sold.
  • buyer (pyvat.Party) -- Buyer.
  • seller (pyvat.Party) -- Seller.
Returns:

The VAT charge to be applied to the sale of an item.

For more detailed documentation, see thefull pyvat documentation.

About

VAT validation for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python99.6%
  • Makefile0.4%

[8]ページ先頭

©2009-2025 Movatter.jp