python 实现银行卡号查询银行名称和简称

本章教程利用python实现查询银行卡号名称和简称 。

目录

 

一、 实例代码

二、运行效果


一、 实例代码

#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: Roc-xb
@desc: python 实现银行卡号查询银行简称
"""
import requestsdef bank_mes(bank_no):try:url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&cardNo={}&cardBinCheck=true"data = requests.get(url.format(bank_no)).json()bank_abbr = data['bank']bank_map = {"ICBC": "中国工商银行","ABC": "中国农业银行","CCB": "中国建设银行","CMB": "招商银行","BOC": "中国银行","PSBC": "中国邮政储蓄银行","COMM": "交通银行","CITIC": "中信银行","CMBC": "中国民生银行","CEB": "中国光大银行","CIB": "兴业银行","SPDB": "浦发银行","GDB": "广发银行","SPABANK": "平安银行","HXBANK": "华夏银行","BJBANK": "北京银行","SHBANK": "上海银行","JSBANK": "江苏银行","BJRCB": "北京农商银行","JSRCU": "江苏省农村信用社联合社","BOYK": "营口银行","WOORI": "友利银行","DZLCYRCZYH": "陵城圆融村镇银行","BXBANK": "本溪市商业银行","WHBANK": "乌海银行","AXDSCB": "安新大商村镇银行","RQCZYH": "任丘村镇银行","JXRCU": "江西省农村信用社","JKRFCZYH": "长春经开融丰村镇银行","BOHN": "海南省农村信用社","CRCBANK": "重庆农村商业银行","ASCB": "鞍山银行","LLVB": "兰陵村镇银行","UBCHN": "海口联合农商银行","BSB": "蒙商银行","MMDBCJCZYH": "天水秦州长银村镇银行","CSRCB": "常熟农商银行","NJMSCZYH": "固始天骄村镇银行","IELZSXHDCZYH": "稷山县河东村镇银行","FSVB": "丰南舜丰村镇银行","JSB": "晋商银行","HURCB": "湖北省农信社","ZGCBANK": "北京中关村银行","EGBANK": "恒丰银行","SQZYFDCZYH": "贵阳花溪建设村镇银行","YJSHCB": "永济市三禾村镇银行有限责任公司","GXYHGMCZYH": "长春二道农商村镇银行","SDLJB": "山东利津舜丰村镇银行","LSBANK": "莱商银行","JHBANK": "金华银行","LSBC": "临商银行","YZBANK": "银座村镇银行","XMBANK": "厦门银行","XNZJCZYH": "深圳龙岗鼎业村镇银行","JXYMYH": "江西裕民银行股份有限公司","DBSHMCZYH": "调兵山惠民村镇银行","DRCBCL": "东莞农村商业银行","RBOZ": "珠海华润银行","PZHCCB": "四川银行","GDRCC": "广东省农村信用社联合社","HANABANK": "韩亚银行","TLSHCB": "屯留三禾村镇银行","MTBANK": "浙江民泰商业银行","LANGFB": "廊坊银行","BOJZ": "锦州银行","TJBHB": "天津滨海农村商业银行","LLBJSJJRFCZYH": "东丰吉银村镇银行","HSBANK": "徽商银行","NNJNGMCZYH": "南宁江南国民村镇银行","NXRCU": "宁夏黄河农村商业银行","FXLZCB": "费县梁邹村镇银行","QLBANK": "齐鲁银行","WRCB": "无锡农村商业银行","CGXYYH": "长葛轩辕村镇银行","IBK": "企业银行","BANKWF": "潍坊银行","CZBANK": "浙商银行","LQRB": "临朐村镇银行","ZYTYCZYH": "宁夏西吉汇发村镇银行","HRXJB": "湖南银行","YBF": "豫丰村镇银行","JZCBANK": "焦作中旅银行","TLXXCZYH": "铁岭新星村镇银行","SDSHHJCZYH": "山东商河汇金村镇银行","WCYRCZYH": "武城圆融村镇银行","HKBEA": "东亚银行","GZRCU": "贵州省农村信用社联合社","LPSZSLDCZYH": "六盘水钟山凉都村镇银行","RHMYCZYH": "仁怀蒙银村镇银行","ZZYH": "枣庄银行","HYXHNSCZYH": "宁夏永宁汇发村镇银行","LLYRCZYH": "乐陵圆融村镇银行","ZRCBANK": "张家港农村商业银行","QHJRCB": "清河金农村镇银行","WYYCCZYH": "舞阳玉川村镇银行","DCSFCZYH": "大城舜丰村镇银行","QDCCB": "青岛银行","HDCB": "黔西花都村镇银行","ARCU": "安徽省农村信用社","SDLCYRCZYH": "历城圆融村镇银行","QLXACZYH": "隰县新田村镇银行","ZGCCB": "自贡银行","ALEJHCB": "阿拉尔津汇村镇银行","BOHAIB": "渤海银行","SDEB": "顺德农商银行","HBC": "湖北银行","LYCB": "辽阳银行","FXCB": "阜新银行","PSATCZYH": "盘山安泰村镇银行","WJRCB": "苏州农村商业银行","SDZFQFCZYH": "山东芝罘齐丰村镇银行","HBFNJXCZYH": "乳山天骄村镇银行","HSB": "恒生银行","NYBANK": "广东南粤银行","BGB": "广西北部湾银行","DAQINGB": "龙江银行","CDCB": "成都银行","DZCBANK": "达州市商业银行","HLDB": "葫芦岛银行","ZZZYFDCZYH": "平遥县晋融村镇银行","ZYBZHLCZYH": "遵义播州汇隆村镇银行","HEBXFCZYH": "平舆玉川村镇银行","WZCB": "温州银行","ZJSYHTCZYH": "浙江松阳恒通村镇银行","H3CB": "内蒙古银行","GRCB": "广州农村商业银行","HSBC": "汇丰银行(中国)","QHRC": "青海省农村信用社","LSCCB": "乐山市商业银行","SZSBK": "石嘴山银行","SINO": "永丰银行","CCQTGB": "重庆三峡银行","HSBK": "衡水市商业银行","NJXLRB": "内江村镇银行","GYGSB": "广元贵商村镇银行","SXBANK": "三湘银行","CJYMCZYH": "沙河襄通村镇银行","WAHDCZYH": "平阴蓝海村镇银行","DLB": "大连银行","BHB": "河北银行","LYJDCZYH": "莱阳胶东村镇银行","AMBZJDYFMCZYH": "包头市昆都仑蒙银村镇银行","SXQNRCB": "陕西秦农农村商业银行股份有限公司","YQCCB": "阳泉市商业银行","XTB": "邢台银行","SJBANK": "盛京银行","DYCCB": "东营银行","SDZHQYCZYH": "山东沾化青云村镇银行","BDCBANK": "保定银行","DZBANK": "德州银行","ANTBANK": "网商银行","ZJNX": "浙江农商联合银行","PZBANK": "盘锦银行","CSCB": "长沙银行","PBDLCZYH": "平坝鼎立村镇银行","ZQQLCZYH": "天镇县河东村镇银行","HZCB": "杭州银行","JZBANK": "晋中银行","BOCFCB": "中银富登村镇银行","RCXNSCZYH": "石阡长征村镇银行","SRCB": "深圳农村商业银行","QHSRB": "黄岛舜丰村镇银行","YACCB": "雅安市商业银行","ZYB": "中原银行","SDRCU": "山东省农村信用社联合社","BOHUIHE": "新疆汇和银行","QLCZYH": "青隆村镇银行","GCB": "广州银行","SXRCCU": "陕西省农信社","XJRCU": "新疆农村信用社","JLBANK": "吉林银行","TACCB": "泰安银行","GYCB": "贵阳银行","GSBANK": "甘肃银行","SDLZHJCZYH": "山东临淄汇金村镇银行","LSYH": "辽沈银行","XHCZYH": "新华村镇银行","HHRXCZYH": "兰西农商村镇银行","NXTXJHCB": "宁夏同心津汇村镇银行","NBIZJZSCZCZYH": "松桃长征村镇银行","RZB": "日照银行","DHDYCZYH": "德惠敦银村镇银行","KLB": "昆仑银行","XZBANK": "西藏银行","JJBANK": "九江银行","SXRCU": "山西省农村信用社","HNBANK": "海南银行股份有限公司","DJCZCZYH": "德江长征村镇银行","CGNB": "四川天府银行","WHFMCZYH": "威海富民村镇银行","CZCB": "浙江稠州商业银行","WZMSBANK": "温州民商银行","ETKQHZCB": "鄂托克旗汇泽村镇银行股份有限公司","QWXXTCZYH": "阜平大商村镇银行","SHRCB": "上海农商银行","SNCCB": "遂宁银行","TLBANK": "铁岭银行","NDHB": "宁波东海银行","NXBANK": "宁夏银行","NMGNXS": "内蒙古农村信用社联合社","SNBANK": "苏宁银行","ZQZSGYCZYH": "虞城通商村镇银行","DBSCN": "星展银行","HBRCU": "河北省农村信用社","LXHRCZYH": "岚县慧融村镇银行","GYBYDXCZYH": "贵阳白云德信村镇银行","LNRCC": "辽宁农商银行","DYLSCB": "东营莱商村镇银行","TCCB": "天津银行","BOQZ": "泉州银行","NBBANK": "宁波银行","WHRCB": "武汉农村商业银行","ZYYCCZYH": "正阳玉川村镇银行","NCB": "江西银行","ZJKCCB": "张家口银行","JNBANK": "济宁银行","KELFMCZ": "库尔勒富民村镇银行","XCXPCZYH": "许昌新浦村镇银行","EEDSSHTCZYH": "鄂尔多斯市罕台村镇银行","KLLACB": "垦利乐安村镇银行","HRBANK": "哈尔滨银行","BOQH": "青海银行","YBCCB": "宜宾市商业银行","NJNKCZYH": "南江农科村镇银行","LTSFRB": "乐亭村镇银行","LZYH": "兰州银行","NJCB": "南京银行","JINCHB": "晋城银行","TZCB": "台州银行","CQBANK": "重庆银行","SXBA": "山西银行","PYYRCZYH": "平原圆融村镇银行","URB": "联合村镇银行","FDB": "富滇银行","LYRTCZYH": "长春绿园融泰村镇银行","SCRCU": "四川省农村信用社联合社","AHXABANK": "安徽新安银行","GAXQB": "贵安新区发展村镇银行","YTBANK": "烟台银行","DLRCB": "大连农村商业银行","PCNKCZYH": "平昌农科村镇银行","QYLACZYH": "庆云乐安村镇银行","NYCB": "南阳村镇银行","ASXHNMCZYH": "安顺西航南马村镇银行","BTSDHJGCZYH": "江口长征村镇银行","QHDBANK": "秦皇岛银行","SDHMB": "山东惠民舜丰村镇银行","NBCBANK": "宁波通商银行","JXRJGDCB": "江西瑞金光大村镇银行","SRBANK": "上饶银行","BJCPBSCZYH": "哈尔滨阿城农商村镇银行","HNRCU": "河南省农村信用社","RXBANK": "瑞信村镇银行","HNSSXNSCZYH": "山东金乡蓝海村镇银行","MZKSB": "梅州客商银行","SHZGMCZYH": "平陆县河东村镇银行","BOSZ": "苏州银行","YXCCB": "云南红塔银行","SCMYCZYH": "水城蒙银村镇银行","XIB": "厦门国际银行","BOCD": "承德银行","HUAMINGBANK": "华明村镇银行","YYBSCB": "博商银行","HNRCC": "湖南省农村信用社","XABANK": "西安银行","TRCB": "天津农商银行","BOSH": "新韩银行","GHB": "广东华兴银行","CCHRCZYH": "长春朝阳和润村镇银行","CZRCB": "江南农村商业银行","URMQCCB": "乌鲁木齐银行","MYBANK": "绵阳市商业银行","HDBANK": "邯郸银行","JRCB": "江苏江阴农村商业银行","CITICN": "花旗银行(中国)","KJCZYH": "梅县客家村镇银行","ZJQZQJSYCZYH": "衢江上银村镇银行","HLJRCU": "黑龙江省农村信用社联合社","XJB": "新疆银行","KCBEBANK": "天津金城银行","DYCB": "长城华西银行","QAXLCB": "迁安襄隆村镇银行","BOD": "东莞银行","NCBANK": "南洋商业银行","WHCCB": "威海市商业银行","BOCZ": "沧州银行","BOCY": "朝阳银行","CABANK": "长安银行","BOL": "中原银行洛阳分行","HKB": "汉口银行","WSQBSCZYH": "江苏江都吉银村镇银行","BOP": "平顶山银行","GXRCU": "广西壮族自治区农村信用社联合社","SXCB": "绍兴银行","YJHLLLCZYH": "神池县河东村镇银行","PTFMCZYH": "都匀融通村镇银行","HNCMCJCZYH": "夏县河东村镇银行","YKYHCCB": "营口沿海银行","FJNX": "福建省农村信用社联合社","ZBCB": "齐商银行","GZB": "赣州银行","HZCCB": "湖州银行","GXPNGYCZYH": "浙江文成北银村镇银行","QJCCB": "曲靖市商业银行","ZJLXYSCZYH": "浙江兰溪越商村镇银行","ZXBXBANK": "百信银行","JXBANK": "嘉兴银行","WACZYH": "武安村镇银行","KSRB": "昆山农村商业银行","FJHXBC": "福建海峡银行","BDXHRCZYH": "保德县慧融村镇银行","ZYCBANK": "贵州银行","KYHNSCZYH": "国民村镇银行","YGCB": "前郭县阳光村镇银行","AHDYMFCZYH": "泌阳玉川村镇银行","SDZPQLCZYH": "芜湖圆融村镇银行","ZJTLCB": "浙江泰隆商业银行","NHB": "南海农商银行","CJCCB": "江苏长江商业银行","FBBANK": "富邦华一银行","LZCCB": "柳州银行","FSCB": "抚顺银行","LJYSCJCZYH": "闻喜县晋融村镇银行","QJHMCB": "曲靖惠民村镇银行","GYSFCB": "廊坊市广阳舜丰村镇银行股份有限公司","CZCCB": "长治银行","NXQTXHLSCZYH": "宁夏青铜峡贺兰山村镇银行","BQGYCZYH": "陕西周至农科村镇银行","LUZBANK": "泸州银行","TJNHCZYH": "天津宁河村镇银行","GSRCU": "甘肃省农村信用社","GLBANK": "桂林银行","PDHF": "大洼恒丰村镇银行","ZZBANK": "郑州银行","SDGQHJCZYH": "山东高青汇金村镇银行","TCRCB": "江苏太仓农村商业银行","HSCZB": "湖商村镇银行","CDRCB": "成都农商银行","YSXRCZYH": "元氏信融村镇银行","YTFSZJCZYH": "汝州玉川村镇银行","WZYTMGJHCZYH": "铁门关津汇村镇银行","ZYXPCZCB": "遵义新蒲长征村镇银行","YDNSCZYH": "尧都农商银行村镇银行","GYRCB": "贵阳农村商业银行","ORBANK": "鄂尔多斯银行","BZSFCB": "霸州舜丰村镇银行","NBYZ": "宁波鄞州农商行","SCB": "渣打银行","JLRCU": "吉林省农村信用社联合社","YNRCC": "云南省农村信用社","OJASZCFCZYH": "宁夏彭阳贺兰山村镇银行"}bank_name = bank_map[bank_abbr]print("银行卡号:{}".format(bank_no))print("银行名称:{}".format(bank_name))print("银行简称:{}".format(bank_abbr))except Exception as e:print("银行卡号输入有误:{}".format(e))if __name__ == '__main__':bank_mes("6217001340011005638")

二、运行效果

38e0a941bd334662a7eb133c0e3e708b.png

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/158644.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Vue2 基本语法

Vue2 基本语法 前言Vue2 基本语法脚手架文件结构关于不同版本的Vuevue.config.js配置文件ref属性props配置项mixin(混入)插件scoped样式总结TodoList案例webStorage组件的自定义事件全局事件总线(GlobalEventBus)消息订阅与发布(pubsub&#…

【OpenGauss 列存储学习总结 2】

OpenGauss 列存储学习总结 2 概述文章链接 概述 列存储是一种优化技术,用于在数据库系统中存储和查询大量数据。与传统的行存储方式不同,列存储将每个列的数据分别存储在独立的存储单元中,而不是按照行的方式存储。这种存储方式在分析性查询、…

FFmpeg 6.1 开放源码多媒体框架近日发布了重大更新

导读FFmpeg 6.1 开放源码多媒体框架近日发布了重大更新,带来了新功能、新解码器、新过滤器和许多其他变化。 在 FFmpeg 6.0 “Von Neumann “版本发布八个多月后,FFmpeg 6.1 被命名为 “Heaviside”,引入了多线程 Vulkan 硬件加速解码&#x…

时序预测 | Matlab实现HPO-ELM猎食者算法优化极限学习机的时间序列预测

时序预测 | Matlab实现HPO-ELM猎食者算法优化极限学习机的时间序列预测 目录 时序预测 | Matlab实现HPO-ELM猎食者算法优化极限学习机的时间序列预测效果一览基本介绍程序设计参考资料 效果一览 基本介绍 Matlab实现HPO-ELM猎食者算法优化极限学习机时间序列预测 1.data为数据集…

2023年中国合成云母行业现状及市场格局分析[图]

合成云母是一种通过化工原料经高温熔融冷却析晶而制得的单斜晶系矿物,属于典型的层状硅酸盐,许多性能都优于天然云母,如合成云母的耐温高达1200℃以上,而天然白云母在550℃下就会开始分解,金云母则在800℃开始分解。除…

HC32L110小华半导体SWD模式切换的问题

在将SWD配置为普通引脚并配置为输出后,如果需要重新配置为SWD,需要将其配置为输入才行,如下: Clk_SetFunc(ClkFuncSwdPinIOEn, TRUE); //配置SWD引脚为普通引脚模式 Gpio_InitIOExt(SWCLK_PORT, SWCLK_PIN, GpioDirOut, TRUE,…

麻雀搜索优化算法MATLAB实现,SSA-BP网络

对于麻雀搜索算法的介绍,网上已经有不少资料了,这边公布SSA的matlab实现 下面展示SSA算法的核心代码以及详细注解 % 麻雀搜索算法函数定义 % 输入:种群大小(pop),最大迭代次数(Max_iter),搜索空间下界(lb)&#xff0c…

【C++进阶】二叉搜索树(BSTree)

​👻内容专栏:C/C编程 🐨本文概括:二叉搜索树的基本操作(查找、删除、插入)、二叉搜索树的应用,KV模型。 🐼本文作者:阿四啊 🐸发布时间:2023.11.22 一、二叉搜索树 1.1…

Maven中常用命令以及idea中使用maven指南

文章目录 Maven 常用命令compiletestcleanpackageinstallMaven 指令的生命周期maven 的概念模型 idea 开发maven 项目idea 的maven 配置idea 中创建一个maven 的web 工程在pom.xml 文件添加坐标坐标的来源方式依赖范围编写servlet maven 工程运行调试 Maven 常用命令 compile …

大华智能物联综合管理平台readpic接口任意文件读取漏洞复现 [附POC]

文章目录 大华智能物联综合管理平台readpic接口任意文件读取漏洞复现 [附POC]0x01 前言0x02 漏洞描述0x03 影响版本0x04 漏洞环境0x05 漏洞复现1.访问漏洞环境2.构造POC3.复现 0x06 修复建议 大华智能物联综合管理平台readpic接口任意文件读取漏洞复现 [附POC] 0x01 前言 免责…

(论文阅读58-66)视频描述

58.文献阅读笔记(LRCNs) 简介 题目 Long-term Recurrent Convolutional Networks for Visual Recognition and Description 作者 Jeff Donahue, Lisa Anne Hendricks, Marcus Rohrbach, Subhashini Venugopalan, Sergio Guadarrama, Kate Saenko, T…

AIGC 点亮创作之旅,「重内容」行业也能轻装出发

毋庸置疑,AIGC 的普及成为了内容产业的一束光。 不仅策划们可以从信息挖掘、素材调用、修改编辑等基础文案工作中解放出来,美术也成为 AIGC 的应用强项,基本的加文字、换背景、改尺寸、延展素材等,都能快速解决。 内容创作者们也因…

leetcode:1773. 统计匹配检索规则的物品数量(python3解法)

难度:简单 给你一个数组 items ,其中 items[i] [typei, colori, namei] ,描述第 i 件物品的类型、颜色以及名称。 另给你一条由两个字符串 ruleKey 和 ruleValue 表示的检索规则。 如果第 i 件物品能满足下述条件之一,则认为该物…

使用内网穿透工具实现远程访问本地部署的Odoo企业管理系统

文章目录 前言1. 下载安装Odoo:2. 实现公网访问Odoo本地系统:3. 固定域名访问Odoo本地系统 前言 Odoo是全球流行的开源企业管理套件,是一个一站式全功能ERP及电商平台。 开源性质:Odoo是一个开源的ERP软件,这意味着企…

阿里云学生认证可领300元无门槛代金券(高效计划)

阿里云高校计划学生和教师均可参与,完成学生认证和教师验证后学生可以免费领取300元无门槛代金券和3折优惠折扣,适用于云服务器等全量公共云产品,订单原价金额封顶5000元/年,阿里云百科aliyunbaike.com分享阿里云高校计划入口及学…

下载安装升讯威在线客服系统时提示风险的解决办法

客服系统的服务端程序、客服端程序、配套的配置工具涉及磁盘文件读写、端口监听,特别是经过混淆加密后,可能被部分浏览器或部分杀毒软件提示风险。请忽略并放心使用,如果开发软件是为了植入木马,这个代价可太大了,不如…

危险了:蓝牙协议爆严重安全漏洞!

导读据外媒报道,美国的物联网安全研究公司Armis在蓝牙协议中发现了8个零日漏洞,而这些漏洞将会影响全球超过53亿的设备,包括Android、iOS、Windows、Linux系统设备以及使用短距离无线通信技术的物联网设备。 Armis的研究人员利用这些漏洞构建…

二进制插桩:静态插桩和动态intel pin插桩

目前有两类插桩平台:静态插桩(SBI)和动态插桩(DBI) SBI使用二进制重写方法永久修改磁盘上的二进制文件;DBI不会修改磁盘上的二进制程序,而是监视二进制程序的执行状态,并在其运行时…

C语言杨辉三角(ZZULIOJ1130:杨辉三角)

题目描述 还记得中学时候学过的杨辉三角吗&#xff1f;具体的定义这里不再描述&#xff0c;你可以参考以下的图形&#xff1a;1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 输入&#xff1a;输入只包含一个正整数n&#xff08;1 < n < 30&#xff09;&#xff0c;表示将…

基于PHP的动漫周边购物系统

有需要请加文章底部Q哦 可远程调试 基于PHP的动漫周边购物系统 一 介绍 此动漫周边购物系统系统基于原生PHP开发&#xff0c;数据库mysql&#xff0c;前端bootstrap。用户可注册登录&#xff0c;购物下单&#xff0c;评论等。管理员登录后台可对动漫周边商品&#xff0c;用户…