未知

bank-account-validator的Python项目详细描述


银行帐户验证的python实现。

目前,巴西最大的银行正在实施,因此正在得到验证。没有其他国家的银行实施,但代码是模块化的,可以很容易地完成。

用法:

frombank_account_validator.coreimportBankbank_class=Bank.get('bank_code','country_code')bank_class(branch='branch',branch_digit='branch_digit',account='account',account_digit='account_digit').execute()

示例:

frombank_account_validator.coreimportBank,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 raisedbank_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 raisedbank_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 lengthsbank_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.

贡献

你觉得有什么有趣的功能,还是你发现了一个bug?请告诉我!

当然,您也可以下载项目并发送一些pull requests

您可以通过opening issues发送建议。

你也可以直接联系我。在http://filwaitman.github.io/查看我的联系信息(电子邮件比手机更受欢迎)。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java的目标是从我的项目中删除不起作用的文件   java对for循环的理解   java我完成了在作业要求的位置查找字符的部分,但是如何从我找到的字符串中删除字符呢?   基于帧时的java动画   java请求无效。缺少XGoogUploadCommand标头   java如何在viewsource模式下使用openStream?   grpc grpc_ARG_KEEPALIVE_PERMIT_而不调用java服务器?   java如何通过Junit测试Web服务调用   如何在java中获取鼠标中键?   使用junit在spring测试中加载属性文件   Java中用于类的类修饰符   java多色文本图像   sql无法调试Java中的“连接到数据库失败”异常   java如何指定hibernate连接映射?   java Android工具栏不显示   java仿射转换不同的图形对象   使用终端的java问题   Java在tomcat上查找127.0.0.1失败