Skip to content

Commit e7afc61

Browse files
committed
Update download URL of Belgian bank numbers
This also changes the handling to prefer the English name over other names and handles another variant of not-applicable values.
1 parent d332ee1 commit e7afc61

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

update/be_banks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# update/be_banks.py - script to download Bank list from Belgian National Bank
55
#
6-
# Copyright (C) 2018-2025 Arthur de Jong
6+
# Copyright (C) 2018-2026 Arthur de Jong
77
#
88
# This library is free software; you can redistribute it and/or
99
# modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,7 @@
3232

3333
# The location of the XLS version of the bank identification codes. Also see
3434
# https://www.nbb.be/en/payment-systems/payment-standards/bank-identification-codes
35-
download_url = 'https://www.nbb.be/doc/be/be/protocol/current_codes.xlsx'
35+
download_url = 'https://www.nbb.be/doc/be/be/protocol/grouped_list_current.xlsx'
3636

3737

3838
# List of values that refer to non-existing, reserved or otherwise not-
@@ -48,6 +48,7 @@
4848
'VRIJ - LIBRE',
4949
'VRIJ',
5050
'nav',
51+
'N/A',
5152
)
5253

5354

@@ -72,7 +73,7 @@ def get_values(sheet):
7273
for row in rows:
7374
row = [clean(column.value) for column in row]
7475
low, high, bic = row[:3]
75-
bank = ([x for x in row[3:] if x] + [''])[0]
76+
bank = ([''] + [x for x in row[2:] if x])[-1]
7677
if bic or bank:
7778
yield low, high, bic.replace(' ', ''), bank
7879

0 commit comments

Comments
 (0)