natural.bank
¶
-
natural.bank.
bban
(value, country=None, validate=False)¶ Printable Basic Bank Account Number (BBAN) for the given country code. The
country
must be a valid ISO 3166-2 country code.Parameters: - value – string or int
- country – string
>>> bban('068-9999995-01', 'BE') '068999999501' >>> bban('555', 'NL') '555' >>> bban('555', 'NL', validate=True) Traceback (most recent call last): ... ValueError: Invalid BBAN, number does not match specification >>> bban('123', 'XY', validate=True) Traceback (most recent call last): ... ValueError: Invalid BBAN, country unknown
-
natural.bank.
bban_base10
(number)¶ Printable Basic Bank Account Number in base-10.
Parameters: number – string >>> bban_base10('01234567') '45670123' >>> bban_base10('ABCD') '10111213'
-
natural.bank.
bban_compact
(number)¶ Printable compacted Basic Bank Account Number. Removes all the padding characters.
Parameters: number – string >>> bban_compact('1234.56.78.90') '1234567890' >>> bban_compact('068-9999995-01') '068999999501'
-
natural.bank.
iban
(number, validate=False)¶ Printable International Bank Account Number (IBAN) as specified in ISO 13616.
Parameters: number – string >>> iban('BE43068999999501') 'BE43 0689 9999 9501' >>> iban('XY32012341234123', validate=True) Traceback (most recent call last): ... ValueError: Invalid IBAN, country unknown >>> iban('BE43068999999502', validate=True) Traceback (most recent call last): ... ValueError: Invalid IBAN, digits check failed