Skip to main content

Parses Iban and Swift/BIC

Project description

ibans

A simple yet powerfull package for validating parsing ibans

FEATURES

  • Validating IBAN
    • Checks if the country suports iban

    • Validate the IBAN string size for the specific country

    • Validate the check code for countries with fix checkcode

    • Validate the structure of BBAN for the specific country

    • Validate the entire IBAN using MOD 97 operaationas decribed by ISO-7064

  • Parsing IBAN will get the following info
    • Country name

    • Country Alpha2 code

    • Check Code

    • Basic Bank Acount Number

    • (If Available) Bank Code

    • (If Available) Account number

    • (If Available) SWIFT

    • (If Available) Sigla

    • (If Available) Bank Name

    • (If Available) Branch code

    • (If Available) Account Type

    • (If Available) Account Holder

    • (If Available) Balance Account Number

    • (If Available) Currency Code

Instalation

Install using pip with:

pip install ibans

Usage

Using the package is as simple as shown below

Parse IBAN

to parse an iban just call

>>> import ibans
>>> iban =  ibans.parse("AO06005500009209313310152")

>>> iban.country
'Angola'

>>> iban.country_code
'AO'
>>> iban.check_digit
'06'

>>> iban.basic_bank_account_number
005500009209313310152

>>> iban.bank_code
'0055'

>>> iban.account_number
'00009209313310152'

>>> iban.bank_name
'Banco Privado Atlântico, S.A.'

>>> iban.sigla
'BPA'

>>> iban.swift_bic
'PRTLAOLU'

Format IBAN

Formating example

>>> from ibans import Iban, IbanFormat
>>> iban =  ibans.parse("AO06 0055 0000 9209 3133 1015 2")
>>> iban.format(IbanFormat.PRINT)
'AO06 0055 0000 9209 3133 1015 2'
>>> iban.format(IbanFormat.PRINT_HIDDEN)
'AO06 **** **** **** **** *015 2'
>>> iban.format(IbanFormat.ELECTRONIC)
'AO06005500009209313310152'

Formating example for (Belgium)

>>> from ibans import Iban, IbanFormat
>>> iban =  ibans.parse("BE71096123456769")
>>> iban.format(IbanFormat.PRINT)
'BE71 096 1 2345 67 69'

Formating example for (Cyprus)

>>> from ibans import Iban, IbanFormat
>>> iban =  ibans.parse("CY17002001280000001200527600")
>>> iban.format(IbanFormat.PRINT)
'CY17 002 0 0128 0000 0012 0052 7600'

Contributing

Contribuitions are welcome, please open an issue or send a PR. Please read our Contributing and code of conduct

License

This project is available under MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibans-1.0.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

ibans-1.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file ibans-1.0.0.tar.gz.

File metadata

  • Download URL: ibans-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ibans-1.0.0.tar.gz
Algorithm Hash digest
SHA256 43dbc12a8a3a4c7b6291a71406e1de15fbcfd961c853d1741a0ac91a19af6ed2
MD5 63cb8d9947c5b8323c73de6c851082d7
BLAKE2b-256 eadc11ee0383435f8438e94f025c52d7a64a1fb7932c97adf6efc4dc8088dbb1

See more details on using hashes here.

File details

Details for the file ibans-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ibans-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ibans-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa7798d3d6027d5e424dea676862cf03535442eea07a5747885c0ea676e9f859
MD5 e28f2af982b6e5ec0337e7fbf43a840f
BLAKE2b-256 5bf79925c81dc81cc6bfc072c21bcde62830fe0eeca108ddef24de6ec5adbfc3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page