Adding support for additional countries

Ralf Habacker ralf.habacker at freenet.de
Tue Jul 14 15:22:49 BST 2020


Am 14.07.20 um 13:33 schrieb Prasun Kumar:
Hi Prasun,

> The script netherlands.py uses xlrd module of Python. How to add this  > module dependency in CMake?
I did not found a "ready to used" cmake script, so I suggest to run the 
following simple python script from cmake, which checks, if a python 
module is loadable.

cat cmake/check_python_module.py
----------------------------------------
import imp,sys
try:
     imp.find_module(sys.argv[1])
     exit(0)
except ImportError:
     exit(1)
----------------------------------------

Run that script by cmake with

python cmake/check_python_module.py xrld

and check the exit code 0 - found, 1 - not found.

Additional the file README.md should get the new dependency listed e.g.

installed python modules: ctypes, sqlite3, xlrd >= 0.7.1

Regards
Ralf
> 
> Thanks.
> Prasun
> 
> On Tue, 14 Jul 2020 at 01:25, Prasun Kumar <prasun.code at gmail.com 
> <mailto:prasun.code at gmail.com>> wrote:
> 
>     Hi Ralf,
>     Thanks so much for this info.
>     Just to clarify, the checks that are to be performed by the tool on
>     a given <bank-id> and <account-id> will comprise
>     of matching the BIC from the database of the respective country and
>     constraint checking on the <account-id>.
> 
>     In the case of Germany, every bank has a method field which is used
>     to verify the account number, since no such field
>     is present in the available bank data file, this is not applicable
>     here, right?
> 
>     Thanks,
>     Prasun
> 
> 
>     On Mon, 13 Jul 2020 at 14:22, Ralf Habacker
>     <ralf.habacker at freenet.de <mailto:ralf.habacker at freenet.de>> wrote:
> 
>         Am 11.07.20 um 07:44 schrieb Thomas Baumgart:
>          > Prasun,
>          >
>          > On Montag, 6. Juli 2020 21:30:09 CEST Prasun Kumar wrote:
>          >
>          >> Hi mentors,
>          >> Can you guide me on how should I proceed with adding support
>         for additional
>          >> countries?
>          >>
>          >> As pointed out in the initial discussions by Ralf,
>          >>
>         https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/plugins/ibanbicdata/
>          >> contains some python scripts which are to be used to
>         generate databases
>          >> which should be added to the library.
>          >> The scripts contain the link to the respective bank websites
>         which as much
>          >> I could understand are related to IBANs.
>          >>
>          >> However, it would be helpful to get a confirmation about the
>         expected
>          >> outcomes of this addition.
> 
>         There two goals
>         - Add support for additional countries to the checking library. The
>         bankdata files also need to be added corresponding to these
>         countries.
> 
>         - Create an API for querying the SQLite databases to enable the
>         integration of these databases into other applications.
> 
>         In the kmymoney case they will be a drop in replacement for the
>         present
>         and outdated sqlite databases and the association api (the files
>         located
>         at
>         https://invent.kde.org/office/kmymoney/-/tree/master/kmymoney/plugins/ibanbicdata)
> 
>            There will be only a few modifications required to switch
>         from the
>         present implementation inside kmymoney to the implementation
>         provided by
>         ktoblzcheck, e.g. use classes provided by ktoblzcheck.
> 
>          > I am not sure if that is really feasible. My dutch is very
>         limited but the provided
>          > list only contains the BIC for each institution.
>         Ths is not true, it also provides the bank identifier used to build
>         iban's, see the second column of
>         https://www.betaalvereniging.nl/betalingsverkeer/giraal-betalingsverkeer/bic-sepa-transacties,
> 
>         which is the source for the sqlite database used by kmymoney for
>         netherlands
> 
>         BIC             Identifier
>         AABNNL2A        AABN
> 
>         According to
>         https://www.xe.com/ibancalculator/sample/?ibancountry=the%20netherlands
> 
>         a IBAN for netherland looks like this
> 
>         IBAN    NL91 ABNA 0417 1643 00
>         ISO Country Code        NL (The Netherlands)
>         IBAN Check Digits       91
>         BBAN    ABNA 0417 1643 00
>         Bank Identifier ABNA
>         Account Number  0417164300
>         SEPA Member     Yes
> 
>         and with the help of the IBAN format specification at
>         https://www.ecb.europa.eu/paym/integration/retail/sepa/iban/shared/pdf/iban_registry.pdf
> 
>         it will be possible to implement checks for IBAN's from
>         netherlands (see
>         page 59)
> 
>         Data element                               Example
>         Name of country                            The Netherlands
>         Country code as defined in ISO 3166        NL
>         Domestic account number example            041 71 64 300
>         BBAN
>         BBAN structure                             4!a10!n
>         BBAN length                                14
>         Bank identifier position within the BBAN   Positions 1-4
>         Bank identifier length                     4!a
>         Bank identifier example                    ABNA
>         BBAN example                               ABNA0417164300
>         IBAN
>         IBAN structure                             NL2!n4!a10!n
>         IBAN length                                18
>         IBAN electronic format example             NL91ABNA0417164300
>         IBAN print format example                  NL91 ABNA 0417 1643 00
>         SEPA Country                               Yes
> 
> 
>         where the following character representations are used in this
>         document
>         (see page 5 from the above mentioned document):
> 
>         n
>            Digits (numeric characters 0 to 9 only)
>         a
>            Upper case letters (alphabetic characters A-Z only)
>         c
>            upper and lower case alphanumeric characters (A-Z, a-z and 0-9)
>         e
>            blank space
>         The following length indications are used in this document:
>         nn!
>            fixed length
>         nn
>            maximum length
> 
> 
>          > The swiss version points to a larger list, but reading the
>         specs at
>          >
>          >
>         https://www.six-group.com/dam/download/banking-services/interbank-clearing/de/bc_bank_master/bc_records.pdf
>          >
>          > (sorry, only in German) shows me, that not enough information
>         is contained to be usable
>          > for your endeavor. Just like with the Dutch version, the only
>         information is the BIC
> 
>         The files those specification is designed for is located at
>         https://www.six-group.com/interbank-clearing/de/home/bank-master-data/download-bc-bank-master.html,
> 
>         which provides a column SSIC-IID, which is for example 001008
>         for the
>         SNB (https://en.wikipedia.org/wiki/Swiss_National_Bank).
>         According to
>         the information for switz bank identifier, which is 5!n, that
>         should be
>         00100.
> 
> 
>          > One thing I could envision is that you can add a separate
>         table with columns like
>          >
>          >     Country - BIC - Name of institution - Valid from - Valid
>         until
>          >
>          > and provide it to applications, so that they can check for
>         valid BICs.
> 
>         Which is the case for recent kmymoney.
> 
>         In the second phase of this project an up to date data bank file
>         will be
>         provided and the associated api in the third phase.
> 
>          > But I leave
>          > that to Ralf since I don't know what the goal of the project
>         is at that point. The
>          > one thing I can say is, that the mentioned information is not
>         related to IBANs.
> 
>         Here also with the help of the IBAN format specification at
>         https://www.ecb.europa.eu/paym/integration/retail/sepa/iban/shared/pdf/iban_registry.pdf
> 
>         it will be possible to implement checks for IBAN's from
>         switzerland (see
>         page 76)
> 
>         Data element                               Example
>         Name of country                            Switzerland
>         Country code as defined in ISO 3166        CH
>         Domestic account number example            762 1162-3852.957
>         BBAN
>         BBAN structure                             5!n12!c
>         BBAN length                                17
>         Bank identifier position within the BBAN   Positions 1-5
>         Bank identifier length                     5!n
>         Bank identifier example                    00762
>         BBAN example                               00762011623852957
>         IBAN
>         IBAN structure                             CH2!n5!n12!c
>         IBAN length                                21
>         IBAN electronic format example             CH9300762011623852957
>         IBAN print format example                  CH93 0076 2011 6238
>         5295 7
>         SEPA Country                               Yes
> 
>         Regards
>         Ralf
> 


More information about the Kde-finance-apps mailing list