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.5

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.5
File Size Uploaded Provenance Actions
ocr_stream-2.6.5.tar.gz 68.7 kB Without provenance Details for ocr_stream-2.6.5.tar.gz

Built distribution (wheel)

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

Total release size: 84.5 kB

Release files / ocr_stream-2.6.5.tar.gz

Download URL ocr_stream-2.6.5.tar.gz
Size 68.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5b4399b95f72f8f647304be1460c1a90aca5eac14c6b8d001560b1ca33b1c4a8
BLAKE2b-256 checksum
How to use checksums
cf245a7a66f427534c5bbfebab3b20367aaa16d78a8d8baca871e8adab070058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

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

Download URL ocr_stream-2.6.5-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c9927d545751af06e647b0bc4eabfb8bbe65d21a2662b42a8b5a1a291c2efc0
BLAKE2b-256 checksum
How to use checksums
31df4d6c873ce71faf239f237ecf567b07f34bdedc9b938debaae1eee7dd358e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for ocr-stream 2.6.5

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