wx-ocr
一行代码识别图片文字,无需安装微信
安装
pip install wx-ocr
使用
Python API
from wx_ocr import ocr
# 识别图片
texts = ocr("image.png", return_text_only=True)
print(texts) # ['文字1', '文字2', ...]
# 获取完整结果(包含位置信息)
result = ocr("image.png")
for item in result['ocrResult']:
print(item['text'], item['location'])
# 批量识别
from wx_ocr import ocr_batch
results = ocr_batch(["1.png", "2.png", "3.png"], return_text_only=True)
命令行
# 识别图片
wx-ocr image.png
# JSON 格式输出
wx-ocr --format json image.png
# 批量处理
wx-ocr *.png
# 保存结果
wx-ocr --save --output results/ image.png
说明
- 仅支持 Windows
- 需要 Python 3.8+
- 无需安装微信(项目自带 OCR 文件)
- 基于 wechat_ocr 开发
License
MIT
Metadata
Release files for wx-ocr 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wx_ocr-0.1.6.tar.gz | 70.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wx_ocr-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 105.8 MB
Release files / wx_ocr-0.1.6.tar.gz
| Download URL | wx_ocr-0.1.6.tar.gz |
|---|---|
| Size | 70.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9eb6c5ebceb35298eeea39d4286f254083cbb2e59af5873fa6a4a920709a794
|
|
BLAKE2b-256 checksum How to use checksums |
00960ed32d4bb0572011e9f3c2384ec2afc68601951f0c85c7e90e5d2728fc89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / wx_ocr-0.1.6-py3-none-any.whl
| Download URL | wx_ocr-0.1.6-py3-none-any.whl |
|---|---|
| Size | 35.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16066b0701b5a4d89d3291693fcb3d393638a3bc92a8b782e1ca484da56597fe
|
|
BLAKE2b-256 checksum How to use checksums |
1ba13c5acb5685d279c0164a1c918dc27cbffae3f0bda1f7ca8d2df816c1f5ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|