stdnum.bg.vat¶
VAT (Идентификационен номер по ДДС, Bulgarian VAT number).
The Bulgarian VAT (Данък върху добавената стойност) number is either 9 (for legal entities) or 10 digits (for physical persons, foreigners and others) long. Each type of number has its own check digit algorithm.
>>> compact('BG 175 074 752')
'175074752'
>>> validate('175074752')
'175074752'
>>> validate('175074751')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
- 
stdnum.bg.vat.calc_check_digit_legal(number)¶
- Calculate the check digit for legal entities. The number passed should not have the check digit included. 
- 
stdnum.bg.vat.calc_check_digit_other(number)¶
- Calculate the check digit for others. The number passed should not have the check digit included. 
- 
stdnum.bg.vat.compact(number)¶
- Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace. 
- 
stdnum.bg.vat.is_valid(number)¶
- Check if the number is a valid VAT number. 
- 
stdnum.bg.vat.validate(number)¶
- Check if the number is a valid VAT number. This checks the length, formatting and check digit.