Welcome | Get started | Dive into Lino | Contribute | Topics | Reference | More

lino_xl.lib.sepa.utils

This defines two functions which convert a Belgian National Bank Account Number (NBAN) into an (IBAN, BIC) pair.

There are two ways to implement this:

Usage examples:

>>> belgian_nban_to_iban_bic('340-1549215-66')
('BE07340154921566', 'BBRUBEBB')
>>> belgian_nban_to_iban_bic('001-6012719-56')
('BE20001601271956', 'GEBABEBB')
>>> belgian_nban_to_iban_bic('063-4975581-01')
('BE43063497558101', 'GKCCBEBB')

Here is an invalid Belgian NBAN:

>>> belgian_nban_to_iban_bic("001-1148294-83")  
Traceback (most recent call last):
...
ValidationError: [u'Belgian NBAN ends with 83 (expected 84)!']

This is also used by lino_xl.lib.sepa.

See also:

Functions

be2iban(nban)

Convert Belgian NBAN to an IBAN.

belgian_nban_to_iban_bic(s)

Convert a Belgian National Bank Account Number (NBAN) into an IBAN, BIC pair.

belgian_nban_to_iban_bic_soap(s)

Convert a Belgian National Bank Account Number (NBAN) into an IBAN, BIC pair.

client()

iban2bic(iban)

Return the BIC corresponding to the given Belgian NBAN.

lino_xl.lib.sepa.utils.be2iban(nban)

Convert Belgian NBAN to an IBAN.

Usage examples:

>>> be2iban("001-1148294-84")
'BE03001114829484'

Based on my previous Clipper implementation for TIM: http://code.google.com/p/tim/source/browse/SRC/TIMDATA2.PRG

lino_xl.lib.sepa.utils.iban2bic(iban)

Return the BIC corresponding to the given Belgian NBAN.

This is based on a hard-coded mapping.

Usage examples:

>>> iban2bic('BE03001114829484')
'GEBABEBB'

Based on my previous Clipper implementation for TIM: http://code.google.com/p/tim/source/browse/SRC/TIMDATA2.PRG

lino_xl.lib.sepa.utils.belgian_nban_to_iban_bic(s)

Convert a Belgian National Bank Account Number (NBAN) into an IBAN, BIC pair.

lino_xl.lib.sepa.utils.belgian_nban_to_iban_bic_soap(s)

Convert a Belgian National Bank Account Number (NBAN) into an IBAN, BIC pair.

This method uses the free public SOAP service available at ibanbic.be and thus requires Internet access, is slower, but has the advantage of being more reliable because maintained by an expert.