V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
legend99
V2EX  ›  Python

国税局增值税发票查验平台 国税验证码识别 国税发票查验

  •  
  •   legend99 · 2021-03-03 20:09:42 +08:00 · 1292 次点击
    这是一个创建于 1148 天前的主题,其中的信息可能已经有所发展或是发生改变。

    国税局验证码识别

    Python 请求

    import base64
    import requests
    
    with open('./test02.png', 'rb') as f:
        img_bytes = f.read()
    
    img_base64 = base64.b64encode(img_bytes)
    # '00' 黑色 '01' 红色 '02' 黄色 '03' 蓝色
    data = {'image': str(img_base64, 'utf-8'), 'key': '03'}
    result = requests.post('http://47.99.174.98:8808/captcha', json=data)
    # 返回 json 格式数据{"code": "7RT"}
    print(result.json())
    

    发票查验

    Python 请求

    import requests
    
    # fpdm 为发票代码,fphm 为发票号码,rq 为开票日期,jym 为校验码后六位,专票 jym 为不含税金额
    # data 为脱敏数据,用自己的真实发票查询
    data = {'fpdm': '040001505520', 'fphm': '38507520', 'rq': '20520520', 'jym': '865520'}
    result = requests.post('http://47.99.174.98:8808/fp', json=data)
    print(result.json())
    

    结果如下

    {'key1': '001', 'key2': '20≡20181106≡上海***********≡913101173324054932≡上海松江区乐都路 301 号 3 楼 021-57662117≡******************* 121915447210901≡个人≡ ≡≡≡83298822850720535288≡17.83≡315.00≡≡661610196301≡≡297.17≡0≡≡1', 'key3': '餐饮服务餐饮服务█████297.17█0.060█17.83██3070401000000000000', 'key4': '', 'key5': '1', 'key11': 'o'}

    作者:Open_CV_NLP,Open_CV_NLP_New
    http://47.99.174.98:8808/

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1249 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:05 · PVG 02:05 · LAX 11:05 · JFK 14:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.