aiopytesseract-0.9.0
توضیحات
asyncio tesseract wrapper for Tesseract-OCR
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aiopytesseract-0.9.0 |
| نام | aiopytesseract |
| نسخه کتابخانه | 0.9.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Alexandre Menezes |
| ایمیل نویسنده | alexandre.fmenezes@gmail.com |
| آدرس صفحه اصلی | https://github.com/amenezes/aiopytesseract |
| آدرس اینترنتی | https://pypi.org/project/aiopytesseract/ |
| مجوز | Apache-2.0 |
[](https://github.com/amenezes/aiopytesseract/actions/workflows/ci.yml)
[](https://codecov.io/gh/amenezes/aiopytesseract)
[](https://badge.fury.io/py/aiopytesseract)

[](https://github.com/psf/black)
# aiopytesseract
A Python [asyncio](https://docs.python.org/3/library/asyncio.html) wrapper for [Tesseract-OCR](https://tesseract-ocr.github.io/tessdoc/).
## Installation
Install and update using pip:
````bash
pip install aiopytesseract
````
## Usage
```python
from pathlib import Path
import aiopytesseract
# list all available languages by tesseract installation
await aiopytesseract.languages()
await aiopytesseract.get_languages()
# tesseract version
await aiopytesseract.tesseract_version()
await aiopytesseract.get_tesseract_version()
# tesseract parameters
await aiopytesseract.tesseract_parameters()
# confidence only info
await aiopytesseract.confidence("tests/samples/file-sample_150kB.png")
# deskew info
await aiopytesseract.deskew("tests/samples/file-sample_150kB.png")
# extract text from an image: locally or bytes
await aiopytesseract.image_to_string("tests/samples/file-sample_150kB.png")
await aiopytesseract.image_to_string(
Path("tests/samples/file-sample_150kB.png")read_bytes(), dpi=220, lang='eng+por'
)
# box estimates
await aiopytesseract.image_to_boxes("tests/samples/file-sample_150kB.png")
await aiopytesseract.image_to_boxes(Path("tests/samples/file-sample_150kB.png")
# boxes, confidence and page numbers
await aiopytesseract.image_to_data("tests/samples/file-sample_150kB.png")
await aiopytesseract.image_to_data(Path("tests/samples/file-sample_150kB.png")
# information about orientation and script detection
await aiopytesseract.image_to_osd("tests/samples/file-sample_150kB.png")
await aiopytesseract.image_to_osd(Path("tests/samples/file-sample_150kB.png")
# generate a searchable PDF
await aiopytesseract.image_to_pdf("tests/samples/file-sample_150kB.png")
await aiopytesseract.image_to_pdf(Path("tests/samples/file-sample_150kB.png")
# generate HOCR output
await aiopytesseract.image_to_hocr("tests/samples/file-sample_150kB.png")
await aiopytesseract.image_to_hocr(Path("tests/samples/file-sample_150kB.png")
# multi ouput
async with aiopytesseract.run(
Path('tests/samples/file-sample_150kB.png').read_bytes(),
'output',
'alto tsv txt'
) as resp:
# will generate (output.xml, output.tsv and output.txt)
print(resp)
alto_file, tsv_file, txt_file = resp
```
## Examples
If you want to test **aiopytesseract** easily, can you use some options like:
- docker
- docker-compose
- [streamlit](https://streamlit.io)
### Docker
Just copy and paste the following line.
```bash
docker run --rm --name aiopytesseract -p 8501:8501 amenezes/aiopytesseract
```
### docker-compose
After clone this repo run the command below:
```bash
docker-compose up -d
```
### streamlit app
For this option it's necessary first install `aiopytesseract` and `streamlit`, after execute:
```python
streamlit run https://github.com/amenezes/aiopytesseract/blob/master/examples/streamlit/app.py
```
> note: The streamlit example need **python >= 3.10**
## Links
- License: [Apache License](https://choosealicense.com/licenses/apache-2.0/)
- Code: [https://github.com/amenezes/aiopytesseract](https://github.com/amenezes/aiopytesseract)
- Issue tracker: [https://github.com/amenezes/aiopytesseract/issues](https://github.com/amenezes/aiopytesseract/issues)
- Docs: [https://aiopytesseract.amenezes.net](https://github.com/amenezes/aiopytesseract)
نیازمندی
| مقدار | نام |
|---|---|
| >=0.8.0 | aiofiles |
| >=22.1.0 | cattrs |
| - | mkdocs-material |
| - | mkdocs-material |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl aiopytesseract-0.9.0:
pip install aiopytesseract-0.9.0.whl
نصب پکیج tar.gz aiopytesseract-0.9.0:
pip install aiopytesseract-0.9.0.tar.gz