Coder Social home page Coder Social logo

schwifty's Introduction

image

image

image

image

Gotta get schwifty with your IBANs

schwifty is a Python library that let's you easily work with IBANs and BICs as specified by the ISO. IBAN is the Internation Bank Account Number and BIC the Business Identifier Code. Both are used for international money transfer.

Features

schwifty lets you

  • validate check-digits and the country specific format of IBANs
  • validate format and country codes from BICs
  • generate BICs from country and bank-code
  • generate IBANs from country-code, bank-code and account-number.
  • get the BIC associated to an IBAN's bank-code
  • access all relevant components as attributes

See the docs for more inforamtion.

Versioning

Since the IBAN specification and the mapping from BIC to bank_code is updated from time to time, schwifty uses CalVer for versioning with the scheme YY.0M.Micro.

Installation

To install schwifty, simply:

$ pip install schwifty

Development

We use the black as code formatter. This avoids discussions about style preferences in the same way as gofmt does the job for Golang. The conformance to the formatting rules is checked in the CI pipeline, so that it is recommendable to install the configured pre-commit-hook, in order to avoid long feedback-cycles.

$ pre-commit install

You can also use the fmt Makefile-target to format the code or use one of the available editor integrations.

Project Information

schwifty is released under MIT license and its documentation lives at Read the Docs. The code is maintained on GitHub and packages are distributed on PyPI

Name

Since swift and swiftly were already taken by the OpenStack-project, but we somehow wanted to point out the connection to SWIFT, Rick and Morty came up with the idea to name the project schwifty.

image

schwifty's People

Contributors

adamchainz avatar brunovila avatar cogax avatar dchoroz avatar dennisxtria avatar dnnsthnnr avatar gentoo90 avatar henryk avatar howorkon avatar imad3v avatar insensitiveclod avatar javaes avatar jmfederico avatar jose-reveni avatar kayjay89 avatar krystofee avatar kziovas avatar mdomke avatar mhemeryck avatar mildamade avatar natim avatar osroca avatar pebosi avatar petrboros avatar prome88 avatar r4co0n avatar sh4dowb avatar stegayet avatar taoisu avatar thorin-schiffer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

schwifty's Issues

SyntaxError on import for python 3.6

$ virtualenv -p python3.6 venv36
...
$ . venv36/bin/activate
$ pip3 install schwifty
...
Successfully installed iso3166-2.0.2 pycountry-20.7.3 schwifty-2021.6.1
$ python3 -c "import schwifty"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/venv36/lib/python3.6/site-packages/schwifty/__init__.py", line 3, in <module>
    from schwifty.bic import BIC
  File "/tmp/venv36/lib/python3.6/site-packages/schwifty/bic.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined

Has support for python 3.6 been dropped? The package metadata does not prevent installing in python 3.6. If support has been dropped then this should be specified in python_requires. If it hasn't been dropped then this is a bug.

non exhaustive list of missing BICs

Hey, thanks for the great framework. We've used it to parse some IBANs. The following BICs were not found however, maybe an update is needed:

HLFXGB21N99
MONZGB2LXXX
ECCUIE21XXX
BCLRCHBBXXX
PAYRGB2LXXX
BOFSGBS1141
HLFXGB21M15
HLFXGB21H58
DZNNGB22XXX
CDISALTRXXX
MCBLMUMUXXX
NDEANOKKXXX
SPRONO22XXX
HLFXGB21T97
HLFXGB21P15
DABADKKKXXX
HLFXGB21J59
CPBKGB22XXX
ICRAITRRF90
BSANADADXXX
BEFRCH22XXX
SRLGGB3LXXX
ABANSI2XXXX
DNBANOKKXXX
YORKGB22XXX
RABOBE22XXX
HLFXGB21A51
RBABCH22313
BNCRCRSJXXX
JYBADKKKXXX
BNPAMCM1XXX
HLFXGB21I11
HANDNOKKXXX
HLFXGB21G69
HLFXGB21P54
SHEDNO22XXX
RYGSNO21XXX
RBKOXKPRXXX
CDOTPTP1XXX
KLEPNO21XXX
HLFXGB21F08
BLJCPTPTXXX
SBAKNOBBXXX
YAPECHZ2XXX
BPPNIT2PXXX
ORUEES21XXX
TCCLGB3LXXX
DABANO22XXX
SGSBALTXXXX
OURIBRSPXXX
CANBCVCVXXX
STFBNOKKXXX
NAIAGB21XXX
HYPLCH22XXX
PBANUA2XXXX
MAEBCHZZXXX
SPAVNOBBXXX
BOFSGB21010
BFRILI22XXX
PSTSIE21XXX
SPTRNO22XXX
HLFXGB21M13
SNOWNO22XXX
BOMLAEADXXX
HLFXGB21R05
VTBAAZ22XXX
KBAGCH22XXX
BINAADADXXX
BLPIIT21XXX
EQBKCZPPXXX
TSBSGB2AXXX
HLFXGB21T33
INGBITMMXXX
VPBVLI2XXXX
BCJUCH22XXX
ALBADKKKXXX
BPCVIT2SXXX

deprecation warnings: Package would be ignored (for .bank_registry, .checksum & .iban_registry)

Hi, for information, in packaging schwifty for AUR, I'm coming upon these warnings:

...
writing manifest file 'schwifty.egg-info/SOURCES.txt'
/usr/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'schwifty.bank_registry' as data is deprecated, please list it in `packages`.
    !!


    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'schwifty.bank_registry' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'schwifty.bank_registry' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'schwifty.bank_registry' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.


!!

  check.warn(importable)
/usr/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'schwifty.checksum' as data is deprecated, please list it in `packages`.
    !!


    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'schwifty.checksum' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'schwifty.checksum' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'schwifty.checksum' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.


!!

  check.warn(importable)
/usr/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'schwifty.iban_registry' as data is deprecated, please list it in `packages`.
    !!


    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'schwifty.iban_registry' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'schwifty.iban_registry' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'schwifty.iban_registry' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.


!!

  check.warn(importable)
...

The following versions are used:

python 3.10.9-1
python-setuptools 1:65.6.3-1
python-setuptools-scm 7.1.0-1

InvalidCountryCode: Unknown country-code 'PY'

Paraguay is not defined in the IBAN spec registry:

def _get_iban_spec(country_code: str) -> dict:
    try:
        spec = registry.get("iban")
        assert isinstance(spec, dict)
        return spec[country_code]
    except KeyError:
        raise exceptions.InvalidCountryCode(f"Unknown country-code '{country_code}'")

raises InvalidCountryCode: Unknown country-code 'PY'

TypeError: write() argument must be str, not IBAN

Tried to save to a text file the generated IBAN, however when I try this, it exits the script with the following error :

TypeError: write() argument must be str, not IBAN

How can I find a way to fix this ?

InvalidCountryCode: Unknown country-code 'MA'

MOROCCO is not defined in the IBAN spec registry:

def _get_iban_spec(country_code: str) -> dict:
    try:
        spec = registry.get("iban")
        assert isinstance(spec, dict)
        return spec[country_code]
    except KeyError:
        raise exceptions.InvalidCountryCode(f"Unknown country-code '{country_code}'")

raises InvalidCountryCode: Unknown country-code 'MA'

Thanks for your work 🙏

Custom exception types

ValueError with a string message is raised everywhere in the code, which makes it harder to identify which error has actually happened in the client code.
Like in:

        if len(bank_code) > bank_code_length:
            raise ValueError("Bank code exceeds maximum size {}".format(bank_code_length))

would improve to

        if len(bank_code) > bank_code_length:
            raise BankCodeTooLongError("Bank code exceeds maximum size {}".format(bank_code_length))

Please let me know if I can help.

BTW the lib is amazing, thank you for the outstanding job!

InvalidCountryCode: Unknown country-code 'CG'

Republic of the Congo is not defined in the IBAN spec registry:

def _get_iban_spec(country_code: str) -> dict:
    try:
        spec = registry.get("iban")
        assert isinstance(spec, dict)
        return spec[country_code]
    except KeyError:
        raise exceptions.InvalidCountryCode(f"Unknown country-code '{country_code}'")

raises InvalidCountryCode: Unknown country-code 'CG'

Issue when checking Italian IBAN

Line 34:
sum_ += odds[alphabet.index(char)]
gives an exception if char is T, U ,V W, X, Y or Z because the index of the letter is outside the range of 29 values in odds.
I believe this is due to the fact that odds should include the first 10 numbers twice (for 0-9 and for A-J).

Furthermore the last 3 numbers in odds (27, 28, 26) should be removed. They do not appear in:
https://www.ecbs.org/Download/Tr201v3.9.pdf

NL BIC-list URL integration possible

I am interested in using Schwifty for a number of tasks and was hoping there'd be a BIC-list for it.

I did a little digging, and it'd seem that there's a URL of an excel-sheet that'll provide the latest version of this list for dutch banks:

https://www.betaalvereniging.nl/wp-content/uploads/BIC-lijst-NL.xlsx

They provide an RSS when changes or other anouncements are made about the list:

https://www.betaalvereniging.nl/actueel/nieuws/rubriek/sepa/

More info (in dutch) on:

https://www.betaalvereniging.nl/betalingsverkeer/giraal-betalingsverkeer/bic-sepa-transacties/

I do not know how your 'automated' conversion process works, so I haven't started working on a converter.

I

Support for generating IBANs for countries when bban doesn't start with bank_code

It's not possible to generate IBAN for countries where bban doesn't start with bank_code, e.g. Italy - http://www.xe.com/ibancalculator/sample/?ibancountry=italy

Do you intend to support generating ibans for all countries?

On [9]: iban = IBAN('IT60 X054 2811 1010 0000 0123 456')                                          

In [10]: iban.country_code
Out[10]: 'IT'

In [11]: iban.bank_code
Out[11]: '05428'

In [12]: iban.account_code
Out[12]: '000000123456'

In [13]: iban.branch_code
Out[13]: '11101'

In [14]: IBAN.generate(country_code=iban.country_code, bank_code=iban.bank_code+iban.branch_code, account_code=iban.account_code)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-14-4145eaaa1945> in <module>()
----> 1 IBAN.generate(country_code=iban.country_code, bank_code=iban.bank_code+iban.branch_code, account_code=iban.account_code)

~/.virtualenvs/swift/lib/python3.5/site-packages/schwifty/iban.py in generate(cls, country_code, bank_code, account_code)
    111         account_code = account_code.rjust(account_code_length, '0')
    112         iban = country_code + '??' + bank_code + account_code
--> 113         return cls(iban)
    114 
    115     def validate(self):

~/.virtualenvs/swift/lib/python3.5/site-packages/schwifty/iban.py in __init__(self, iban, allow_invalid)
     67 
     68         if not allow_invalid:
---> 69             self.validate()
     70 
     71     def _calc_checksum_digits(self):

~/.virtualenvs/swift/lib/python3.5/site-packages/schwifty/iban.py in validate(self)
    115     def validate(self):
    116         self._validate_characters()
--> 117         self._validate_length()
    118         self._validate_format()
    119         self._validate_checksum()

~/.virtualenvs/swift/lib/python3.5/site-packages/schwifty/iban.py in _validate_length(self)
    130     def _validate_length(self):
    131         if self.spec['iban_length'] != self.length:
--> 132             raise ValueError("Invalid IBAN length")
    133 
    134     def _validate_format(self):

ValueError: Invalid IBAN length

Empty list of bank codes is returned when using extended format

Given the following example:

>>> bic = BIC('BSABESBB')
>>> bic
<BIC=BSABESBB>
>>> bic.country_code
'ES'
>>> bic.domestic_bank_codes
['0008', '0013', '0042', '0043', '0046', '0081', '0106', '0112', '0118', '0119', '0185', '0209', '0217', '0230', '0236', '2005', '2076', '2090', '2093', '2102']
>>> bic = BIC('BSABESBBXXX')
>>> bic.domestic_bank_codes
[]
>>> bic = BIC('BSABESBB001')
>>> bic.domestic_bank_codes
[]

I will expect that the domestic_bank_codes returns also the same bank codes when using extended format.
Is this the expected behaviour?

Missing `iran` when generating files

When generating files i miss iran because its not in the swift.com iban registry.

We use this package for our python packages but we also have php project which uses Symfony that also has a iban validator there iran ibans are valid see the ticket i created there symfony/symfony#46919

Its probably hard to add this case but it would at least be nice to inform people its missing iban countrys if there not on swift.com iban registry let me know what you guys think.

issues with pyinstaller

Schwifty doesn't work nicely with pyinstaller by default when using the "--onefile"-option. Here is a solution that works for me, just in case someone is interested.

In your pyinstaller-spec file add this:
"from PyInstaller.utils.hooks import copy_metadata, collect_data_files"
and use
"datas = copy_metadata("schwifty")+collect_data_files("schwifty"),"

This copies the generated json files ("bank_registry" and "iban_registry") to your executable. As this adds a subdirectory with the name of the package ("schwifty") and our own directories below that, we need to adjust registry.py: change line 53
from
directory = package_path / f"{name}_registry"
to
directory = package_path / "schwifty" / f"{name}_registry"

Polish IBAN doesn't work

Hey everyone.

I am currently working with schwifty v2022.7.0 and I am trying to parse polish IBAN PL20 1050 1214 1000 0090 3236 2619. However, schwifty somehow does not resolve this IBAN and I cannot get a bank name nor BIC. This IBAN is valid, you can check it on other website apps. So I wonder where could be the problem because I could find BIC in the polish registries.

Faulty data in generated_nl.json

The source file for Dutch banks currently has a blank line on line 78. This resulted in a faulty entry in generated_nl.json:

  {
    "country_code": "NL",
    "primary": true,
    "bic": "",
    "bank_code": "",
    "name": "",
    "short_name": ""
  },

I created #73 and #74 for this assuming that generated_nl.json would be regenerated at some point. But more than a month later the faulty entry is still there. Do I need to submit a pull request for removing the entry itself as well?

Loading Json Registry Encoding Error

Hello first of all great module.

However, when loading the module I get a chamap error in Windows.

Exception: UnicodeDecodeError
'charmap' codec can't decode byte 0x8d in position 416: character maps to <undefined>.

The problem is loading the JSON files.
Since all files are always in UTF-8 you can just specify the format when loading, then there will be no problem with the different operating systems.

Simply change line 47 in the regitry.py from
with entry.open() as fp:

to
with entry.open(encoding='utf-8') as fp:

this should also solve the Docker problem:
https://schwifty.readthedocs.io/en/latest/troubleshooting.html

Best Regards

Max Schwesig

Branch_code merged by error in account_code for some country like France

Hello,

Thanks for your work on this lib.

I start to test it and I discover that you don't return a branch_code for IBAN start by 'FR'. I discover that the spec for FR IBAN is :
On wikipedia we can read that the official format is FRkk bbbb bsss sscc cccc cccc cxx with sssss represent the branch code and xx the National check digits (ref: https://en.wikipedia.org/wiki/International_Bank_Account_Number).

Why you decide to merge bank code and account number ?
What is the best way to fix this problem ?

A+

French IBAN does not always return the right BIC

There are many banks with the same bank_code but different BIC. So when getting the BIC from an IBAN schwifty takes the last bank loaded with the bank_code. I think it will be better in case of ambiguity that no BIC is returned.

N26 Bic missing

I have found an new bank that the BIC is not generated
The IBAN starts with ES38 1563, and the bank is N26 Bank Gmbh, Sucursal En Espana

Probably all the Neobanks are not included (N26, Revolut, Rebellion, ....)

Unknown county code VA

I tested the with this dataset:
VA10915379254552996235
VA09767737450222509340

Output:
Unknown country code: 'VA'

Expected:
Valid

What is the meaning of "tbd" and "primary" properties in bank-registry.json?

Thanks for your work on this lib.
I'm trying to enhance it with banks from Spain and I would like to know that are the meaning of properties tbd and primary listed tin the bank-registry.json file.

FYI, I'm trying to get official data from the Central Bank of Spain (Banco de España) and if they provide the banks data including the BIC/SWIFT code, I would like to include a script like convert_blz_doc.py to auto-populate the bank-registry file.

UnicodeDecodeError when importing library in python3

Hi,
When I try to import the library in python3 it just break in an exception

>>> from schwifty import IBAN Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/dist-packages/schwifty/__init__.py", line 3, in <module> from schwifty.bic import BIC File "/usr/local/lib/python3.5/dist-packages/schwifty/bic.py", line 233, in <module> registry.build_index("bank", "bic", key="bic", accumulate=True) File "/usr/local/lib/python3.5/dist-packages/schwifty/registry.py", line 48, in build_index base = get(base_name) File "/usr/local/lib/python3.5/dist-packages/schwifty/registry.py", line 24, in get chunk = json.load(fp) File "/usr/lib/python3.5/json/__init__.py", line 265, in load return loads(fp.read(), File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 71: ordinal not in range(128)

Steps:

  • Create new docker container with image ubuntu:16.04
  • Enter in the container
  • apt update
  • apt install python3-pip
  • pip3 install schwifty
  • python3
  • from schwifty import IBAN

workaround:

  • pip3 install schwifty==2020.1.1

Does not work for country code SE

When trying to work with Swedish bank accounts I get the error:
ValueError: Bank code exceeds maximum size 3

I used the bank details:
country_code = 'SE'
bank_code = '6789'
account_code = '123456789'

According to other calculators it should work.

maintenance

Please change the maintainer of the package to figo GmbH instead of @mdomke . And make sure the pypi account is owned by figo.

Thanks.

[FR] Revolut Bank BIC is Missing

The Revolut Bank, with BIC REVOFRP2 is missing on the latest version of the package.
Here an example of a such IBAN : FR7628233000018465152778611

As we can see on https://fr.iban.com/iban-checker, it's a good Revolut IBAN !

Capture d’écran 2023-02-08 à 11 54 05

Ping @mdomke

A `TypeError` is raised when obtaining `bic` of a Ukrainian IBAN.

Steps to reproduce

from schwifty.iban import IBAN
iban = IBAN(iban="UA***ukrainian-IBAN-here***")
bic = iban.bic

results in the stacktrace

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "***/venv/lib/python3.8/site-packages/schwifty/iban.py", line 288, in bic
    return BIC.from_bank_code(self.country_code, self.bank_code or self.branch_code)
  File ***/venv/lib/python3.8/site-packages/schwifty/bic.py", line 114, in from_bank_code
    return cls(spec[(country_code, bank_code)]["bic"])
  File "***/venv/lib/python3.8/site-packages/schwifty/bic.py", line 52, in __init__
    super().__init__(bic)
  File "***/venv/lib/python3.8/site-packages/schwifty/common.py", line 13, in __init__
    self._code = clean(code)
  File "***/venv/lib/python3.8/site-packages/schwifty/common.py", line 50, in clean
    return _clean_regex.sub("", s).upper()
TypeError: expected string or bytes-like object

Versions tested

Produced in python 3.8 but I suspect the bug is independent of the python-version.

Versions where the bug appears: 2023.3.0, 2023.2.1, 2023.2.0.

Diagnosis

I think this is the offending commit: e4c4aef - the ukrainian banks have "bic": null. With the BIC.from_bank_code call we initialize a BIC instance with None, which is unexpected. Before it was added, we would catch a KeyError in BIC.from_bank_code which reraises as an InvalidBankCode exception.

I don't know what would we preferred, either catch the null-values or prevent them to be in the generated_ua.json in the first place?

Make use of dunder __len__

The package schwifty make extensive use of a property length. This makes it hard to:

  • Integrate with libraries like django that rely on the dunder method. (If their's any need to len(IBAN(...)) we are force to inherit from the class and implement the dunder method __len__ ourselfs).

Was their any reason to create a property length instead of using the dunder ?

BIC.bank_names doesn't let me get the actual bank name for an IBAN

Hello!

We are currently trying to get the bank name for a given IBAN, but in some cases, when a bank might have many names, we are unable to get the actual name for the bank.
The specific case we've ran into is using an IBAN for Banco Sabadell (spanish), BIC BSABESBB and bank code 0081, but when trying to get the bank name, we get ABBEY NATIONAL BANK, S.A.E..

Looking into the code, I think that the problem comes because BIC.bank_names returns a sorted list of names for the given BIC code and when going from and IBAN to a BIC, we lose the context of the actual bank code.

I can think of a couple changes but I'd love to have your opinon first @mdomke

This is what we currently do to get the bank name:

name = schwifty.IBAN(value).bic.bank_names[0]

Turkish IBAN - Branch is empty string?

Hi
Thanks for this library, it really helps 😃 (and it has a nice name)

I have a problem regarding Turkey.
Whenever I parse a Turkish IBAN the branch code is an empty string.
I looked at the code and it seems like the branch part the start index and end index is the same - link to relevant part in json file.

Here's an example of a site that can decode the branch part given a Turkish IBAN - link.

Any ideas how I can achieve this decoding of the branch part as well using schwifty?

Thanks

SI IBAN prefix

The specifications for SI IBAN are technically correct, but in reality the central bank of Slovenia uses only 56 as the "2!n" part after SI. Consiquently all IBANs start with SI56 - see the link for more info.

Bank names return a list of obsolete names

In the following example:

>>> from schwifty import BIC, IBAN
>>> bic = BIC('BSABESBB')
>>> bic.bank_names
['ABBEY NATIONAL BANK, S.A.E.', 'ACTIVOBANK, S.A.', 'BANCO ATLANTICO, S.A.', 'BANCO CAM, S.A.', 'BANCO DE ASTURIAS, S.A.', 'BANCO DE SABADELL, S.A.', 'BANCO GALLEGO, S.A.', 'BANCO GUIPUZCOANO, S.A.', 'BANCO HERRERO, S.A.', 'BANCO SANPAOLO, S.A.', 'BANCO URQUIJO SABADELL BANCA PRIVADA, S.A.', 'BANCO URQUIJO, S.A.', 'CAJA DE AHORROS PROVINCIAL DE ALICANTE', 'CAJA DE AHORROS PROVINCIAL DE ALICANTE Y VALENCIA', 'CAJA DE AHORROS PROVINCIAL DE VALENCIA', 'CAJA GRAL.DE AHORROS Y MONTE DE PIEDAD DE TORRENT', 'LLOYDS BANK INTERNATIONAL, S.A.', 'LLOYDS TSB BANK PLC, S.E.', 'SABADELL SOLBANK, S.A.', 'SOLBANK SBD, S.A.']

The list of bank names is all the names that had been adquired by BANK SABADELL. For example. Banco adlantico, and also Banco gallego

Can we have some API to return the main bank name associated to a bic? Another option is to just return the names sorted by currenct activity. Normally it should be only one active bank associated to a bic.

Our use case is that given an IBAN number we are guessing the bank name using the BIC code. But in such case an algorithm can not pick the best name.

France BBAN : multiple errors in registry + no BBAN checksum algorithm

Hello, working with french IBAN, I noticed schwifty doesn't pack an algorithm for BBAN checksum computing.

I just managed to make it work, but not being a developper and not having enough time, I certainly managed things the wrong way.

I've pushed my changes to my fork : sholan/schwifty commit sha : 1816a01

Those changes are :

  • Adding : checksum/france.py with a sub-optimal code architecture but functionnal see clef rib on wikipedia to understand the key computing method (simplified)
  • change : checksum/init.py to load the algorithm
  • change : iban.py to add 'FR' in the if/elif list of country codes for which BBAN checksum is available
  • change : iban_registry/generated.json : correction on account_code and branch_code positions (those informations are available in BANKDIRECTORYPLUS as published by swift)

I am sorry to not provide more help, as a simple pull request with everything perfectly done

BIC missing

I am using this utility to calculate BIC SWIFT

Theese IBAN's have not any BIC code

  • ES73 3070 CAIXA R. GALEGA, S.C.C.L.G.
  • ES44 1491 TRIODOS BANK, N.V., S.E.

iban.bic = None for 'LT...' iban

from schwifty import IBAN  

iban_obj = IBAN('LT663250028366006186')
> <IBAN=LT663250028366006186>

iban_obj.bic
> None

why does it have no bic?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.