This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Python implementation for bank account validation.

Currently, the biggest Brazilian banks are implemented - and so being validated. There is no other countries’ banks implemented, but the code is modular and it can be done easily.


from bank_account_validator.core import Bank
bank_class = Bank.get('bank_code', 'country_code')
bank_class(branch='branch', branch_digit='branch_digit',
           account='account', account_digit='account_digit').execute()


from bank_account_validator.core import Bank, BrazilianBank

# Account below is correct, so nothing is raised by calling execute()
bank_class = Bank.get('237', 'BR')
bank_class(branch='1769', branch_digit='8', account='200040', account_digit='7').execute()

# Account below has invalid branch so InvalidBranch will be raised
bank_class = BrazilianBank.get('237')
bank_class(branch='1769', branch_digit='0', account='200040', account_digit='7').execute()
# InvalidBranch: Branch "1769-0" is wrong.

# Account below has invalid account so InvalidAccount will be raised
bank_class = BrazilianBank.get('237')
bank_class(branch='1769', branch_digit='8', account='200040', account_digit='0').execute()
# InvalidAccount: Account "0200040-0" is wrong.

# Sometimes there is not an unitary validation for both branch and account
# I mean, the full combination is evaluated at once.
bank_class = BrazilianBank.get('033')
bank_class(branch='2006', branch_digit='', account='01008407', account_digit='1').execute()
# InvalidBranchAndAccountCombination: Combination (branch="2006", account="01008407-1") does not match.

# It also validates wether digits must be supplied or not, as well as branch/account lengths
bank_class = BrazilianBank.get('237')
bank_class(branch='111769', branch_digit='8', account='200040', account_digit='7').execute()
# InvalidBranchlength: For bank code "237", branches length must be 4.

bank_class(branch='1769', branch_digit='8', account='11200040', account_digit='7').execute()
# InvalidAccountlength: For bank code "237", accounts length must be 7.

bank_class(branch='1769', branch_digit='', account='200040', account_digit='7').execute()
# MissingBranchDigit: For bank code "237", branches must have a digit, of length 1.

bank_class(branch='1769', branch_digit='11', account='200040', account_digit='7').execute()
# UnexpectedBranchDigit: For bank code "237", branches must have 1 digits.

bank_class(branch='1769', branch_digit='8', account='200040', account_digit='').execute()
# MissingAccountDigit: For bank code "237", accounts must have a digit, of length 1.

bank_class(branch='1769', branch_digit='8', account='200040', account_digit='11').execute()
# UnexpectedAccountDigit: For bank code "237", accounts must have 1 digits.


Did you think in some interesting feature, or have you found a bug? Please let me know!

Of course you can also download the project and send me some pull requests.

You can send your suggestions by opening issues.

You can contact me directly as well. Take a look at my contact information at (email is preferred rather than mobile phone).

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bank-account-validator-0.1.tar.gz (15.5 kB) Copy SHA256 Checksum SHA256 Source Feb 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting