1 Star 0 Fork 79

firecream / Any2Excel

forked from celaraze / any-to-excel 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
image2excel.py 628 Bytes
一键复制 编辑 原始数据 按行查看 历史
Famio 提交于 2020-08-19 18:22 . 开源释出
import sys
import os
import ocr
import draw
import xlrd
import xlwt
import yaml_class
from xlutils.copy import copy
pic_path = sys.argv[1]
pic_name = os.path.split(pic_path)[-1].split(".")[0]
print('doing')
# 使用ocr进行转换
config = yaml_class.get_yaml_data("config.yml")
jpg_name = './images_temp/'+pic_name+'/0.jpg'
trans = ocr.OCR()
path_excel = trans.img_to_excel(
pic_name,
image_path=pic_name,
secret_id=config['secret_id'],
secret_key=config['secret_key'],
)
old_excel = xlrd.open_workbook('output.xlsx')
new_excel = copy(old_excel)
ws = new_excel.get_sheet(0)
new_excel.save(pic_name+'.xls')
Python
1
https://gitee.com/firecream/Any2Excel.git
git@gitee.com:firecream/Any2Excel.git
firecream
Any2Excel
Any2Excel
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891