Skip to main content

Yescan CLI - 夸克扫描王命令行工具

Project description

Yescan CLI

夸克扫描王命令行工具,支持 OCR 识别、图像增强、文档转换等功能。

环境要求

  • Python >= 3.8
  • pip

安装

cd yescan-tool
bash install.sh

或手动安装:

cd yescan-tool
pip install .

安装完成后,yescan 命令即可全局使用。

卸载

yescan uninstall

或手动卸载:

pip uninstall yescan

配置

yescan config set SCAN_WEBSERVICE_KEY your-api-key

获取 API Key:https://scan.quark.cn/business → 开发者后台 → 登录/注册 → 查看 API Key

配置文件保存在 ~/.yescan/config.json

其他配置命令

# 查看配置
yescan config get SCAN_WEBSERVICE_KEY

# 列出所有配置
yescan config list

# 删除配置
yescan config delete SCAN_WEBSERVICE_KEY

也支持环境变量方式:export SCAN_WEBSERVICE_KEY="your-api-key"

命令参考

OCR 识别

# 基本格式
yescan --scene <场景名> --path <本地图片路径>
yescan --scene <场景名> --url <图片URL>

# 简写
yescan -s <场景名> -p <图片路径>
yescan -s <场景名> -u <图片URL>

# 指定输出目录(保存结果文件)
yescan -s <场景名> -p <图片路径> -o <输出目录>
yescan -s <场景名> -p <图片路径> --output <输出目录>

注意:使用 --url/-u 参数时,URL 建议用单引号包裹(如 -u 'https://...'),避免 shell 对特殊字符(如 ! $ 等)进行解析。

--output/-o 参数说明

场景类型 不指定 --output 指定 --output
OCR 识别类 直接打印 JSON 结果 保存 JSON 到指定目录
图像增强类 保存图片到 /tmp/imgs/ 保存图片到指定目录
文档转换类 保存文档到 /tmp/documents/ 保存文档到指定目录

输出格式(指定 --output 时):

{"code": 0, "msg": "success", "data": {"path": "/absolute/path/to/file"}}

配置管理

# 设置配置
yescan config set <KEY> <VALUE>

# 查看配置
yescan config get <KEY>

# 列出所有配置
yescan config list

# 删除配置
yescan config delete <KEY>

其他命令

# 查看帮助
yescan --help
yescan -h

# 查看版本
yescan --version
yescan -v

# 列出所有可用场景
yescan --list-scenes

使用示例

OCR 识别类

# 身份证识别(直接打印 JSON)
yescan -s idcard-ocr -p ./idcard.jpg

# 通用 OCR(URL 输入)
yescan -s general-ocr -u 'https://example.com/doc.jpg'

# 表格识别(保存 JSON 到指定目录)
yescan -s table-ocr -p ./table.png -o ./results/

图像增强类

# 去除水印(保存到默认目录 /tmp/imgs/)
yescan -s remove-watermark -p ./image.png

# 去除水印(保存到指定目录)
yescan -s remove-watermark -p ./image.png -o ./output/

# 试卷增强
yescan -s exam-enhance -u 'https://example.com/exam.jpg' -o ./enhanced/

文档转换类

# 图片转 Word(保存到默认目录 /tmp/documents/)
yescan -s image-to-word -p ./doc.jpg

# 图片转 Excel(保存到指定目录)
yescan -s image-to-excel -p ./table.png -o ./docs/

# 图片转 PDF
yescan -s image-to-pdf -p ./doc.jpg -o ./docs/

可用场景

OCR 识别类

场景名 说明
general-ocr 通用文字识别
handwritten-ocr 手写文字识别
table-ocr 表格识别
idcard-ocr 身份证识别
driver-license-ocr 驾驶证识别
vehicle-license-ocr 行驶证识别
vat-invoice-ocr 增值税发票识别
train-ticket-ocr 火车票识别
business-license-ocr 营业执照识别
degree-certificate-ocr 学位证识别
formula-ocr 公式识别
question-ocr 题目识别
social-security-card-ocr 社保卡识别
travel-permit-ocr 通行证识别
commercial-invoice-ocr 商业发票识别
medical-report-ocr 医疗报告识别
product-image-ocr 商品包装识别

图像增强类

场景名 说明
exam-enhance 试卷增强
image-hd-enhance 高清增强
certificate-enhance 证件增强
remove-handwriting 去除手写
remove-watermark 去除水印
remove-shadow 去除阴影
remove-screen-pattern 去除摩尔纹
remove-background-color 去除背景色
image-crop-rectify 裁切矫正
sketch-drawing 素描风格
extract-lineart 提取线稿
scan-document 文档扫描
scan-contract 合同高清

文档转换类

场景名 说明
image-to-word 图片转 Word
image-to-excel 图片转 Excel
image-to-pdf 图片转 PDF

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yescan-1.0.1.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yescan-1.0.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file yescan-1.0.1.tar.gz.

File metadata

  • Download URL: yescan-1.0.1.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for yescan-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3265e117a2d11f0246c277edb35e4b0a4e4af38a6f1d8eabcffbd2d30059cbbc
MD5 dc25960a9795f9933dbfaafc06fe978c
BLAKE2b-256 cd09dfcb35fac56106142e8ecada8f844c1a5b2a29560d611c8f51a571376bb8

See more details on using hashes here.

File details

Details for the file yescan-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: yescan-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for yescan-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ae3f3b44e8b68a0ac9b224c97c390d11043630e316045031bb7ac37c1c47ba
MD5 d307ae6565cf69d9150f23cb5078ad66
BLAKE2b-256 5ffc1cd2a3e619c6e46f544fae4e2b2b8b44e2f4c9020691504d3766e654d53e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page