guanshuicheng / invoice

Collaboration with wangxupeng(https://github.com/wangxupeng)
MIT License
1.82k stars 454 forks source link

API調用 #36

Open maxkaoppp opened 3 years ago

maxkaoppp commented 3 years ago

請問一下 要怎麼POST照片

yiyuezhuo commented 3 years ago
import requests
resp = requests.post("http://127.0.0.1:11111/invoice-ocr", files={"file": open("test.jpg", 'rb')})
resp.content.decode()

# '{"FileName":"test.jpg","code":100,"data":{"发票代码":"144001809010","发票号码":"00000001","校验码":":00000"," 税后价格":"¥106.60"},"message":"识别成功","ocrIdentifyTime":"2021-04-20 16:56:50"}\n'
wangshuai-007 commented 2 years ago

作者有附图说明使用方法: 使用方法