Giter Site home page Giter Site logo

ibans-python's Introduction

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

ibans-python's People

Contributors

iltoningui avatar pjstevns avatar

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.