Skip to main content

ocrlib

Uso simples

from ocr_stream import File, TextRecognized, RecognizeImage, RecognizePdf

passo 1:

instânciar o objeto para reconhecer texto, utilizando o caminho do tesseract

tess: File = File('/usr/bin/tesseract') # Substitua pelo tesseract do seu sistema ocr = RecognizeImage.create(path_tesseract=tess)

passo 2:

instânciar um arquivo de imagem para extrair o texto.

image: File = File('path/to/file.png')

passo 3:

extrair o texto

text: str = ocr.image_to_string(image) print(text)

passo 4 opcional:

você pode salvar um arquivo PDF com o texto extraido

output_file: File = File('path/to/save.pdf') recognized: TextRecognized = ocr.image_recognize(image) recognized.to_document().to_file_pdf(output_file)

passo 5 opcional:

você pode salvar uma planilha com o texto da imagem

output_excel: File = File('path/to/file.xlsx') recognized: TextRecognized = ocr.image_recognize(image) recognized.to_document().to_excel(output_excel)

Metadata

Release files for ocr-stream 2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocr-stream 2.6
File Size Uploaded Provenance Actions
ocr_stream-2.6.tar.gz 76.5 kB Without provenance Details for ocr_stream-2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ocr-stream 2.6
File Interpreter ABI Platform Actions
ocr_stream-2.6-py3-none-any.whl Python 3 none any Details for ocr_stream-2.6-py3-none-any.whl

Total release size: 91.8 kB

Release files / ocr_stream-2.6.tar.gz

Download URL ocr_stream-2.6.tar.gz
Size 76.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2edcb38600718623eeab9fd0cbb9cb3b059187504980580f276e29aae8751693
BLAKE2b-256 checksum
How to use checksums
e86ff82d55023049694441e2e0beae97ba8468039ddd9be50e938c637964c6fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ocr_stream-2.6-py3-none-any.whl

Download URL ocr_stream-2.6-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
658091574813fc1bc7c0986ede5fc921f541c853ec3e062623c1f42d4067bc3c
BLAKE2b-256 checksum
How to use checksums
1bda2b039c82247188cc7871ea7430248de504935a791bfeddef852b51bb19af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for ocr-stream 2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page