Skip to main content

Python implementation for bank account validation.

Project description

Heimdall

Heimdall is the guardian of the rainbow bridge, which is the onlu way to Asgard (heaven) bouding with Midgard (earth) os nordic mithology, for this project Heimdall is responsible for not letting invalid bank data to be accepted.

image

Bank Account Validate

Heimdall is a Python package which validates the main brazilian banks: Itaú, Bradesco, Caixa, Banco do Brasil, Citibank, Santander, Banrisul and Nubank. For the remaining ones it is used a default validation:

  • Agency is required to have 1 up to 5 digits
  • Agency Branch is required to have 0 up to 2 characters
  • Account is required to have 1 up to 12 digits
  • Account Branch is required to have 0 up to 2 characters

Basic Usage

Install with pip:

pip install wheel && pip install heimdall_valid_bank

To validate the entire bank account, follow these steps:

from heimdall_valid_bank.data_bank_validate import DataBankValidate

valid_bank = DataBankValidate(
                bank_code='001',
                agency='1584',
                digit_agency='9',
                account='00210169',
                digit_account='6'
            ).start()

if valid_bank == True:
    print('Bank Valid')
else:
    print('Bank Invalid')

You can also validate in stages, using BankValidate, AgencyValidate, AccountValidate,:

Examples:

  • basic agency validation:
from heimdall_valid_bank.agency_validate import AgencyValidate

valid_bank = AgencyValidate(
                bank_code='237',
                agency='2377-8'
            ).start()

if valid_bank == True:
    print('Agency Valid')
else:
    print('Agency Invalid')
  • validation with agency branch
from heimdall_valid_bank.agency_validate import AgencyValidate

valid_bank = AgencyValidate(
                bank_code='001',
                agency='1584',
                digit_agency='9'
            ).start()

if valid_bank == True:
    print('Agency Valid')
else:
    print('Agency Invalid')
  • agency validation by passing the branch directly at the agency, if you have:
from heimdall_valid_bank.agency_validate import AgencyValidate

valid_bank = AgencyValidate(
                bank_code='001',
                agency='1584-9'
            ).start()

if valid_bank == True:
    print('Agency Valid')
else:
    print('Agency Invalid')

License

Heimdall is released under the MIT license. See the bundled LICENSE file for details.

Credits

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

heimdall_valid_bank-1.0.8.tar.gz (21.1 kB view details)

Uploaded Source

File details

Details for the file heimdall_valid_bank-1.0.8.tar.gz.

File metadata

  • Download URL: heimdall_valid_bank-1.0.8.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5

File hashes

Hashes for heimdall_valid_bank-1.0.8.tar.gz
Algorithm Hash digest
SHA256 529e3a2204ddeea97e4a59375e0fd75a0488134b49f64b7097f4f04b861e9473
MD5 9bf3d4ff677635991a3f60fd4389d63b
BLAKE2b-256 32fe5de023f66f45dd253df1fd4c35e649e1d88e2bd4808960ec7d4f64863384

See more details on using hashes here.

Supported by

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