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

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.3
File Size Uploaded Provenance Actions
ocr_stream-2.6.3.tar.gz 68.4 kB Without provenance Details for ocr_stream-2.6.3.tar.gz

Built distribution (wheel)

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

Total release size: 83.7 kB

Release files / ocr_stream-2.6.3.tar.gz

Download URL ocr_stream-2.6.3.tar.gz
Size 68.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a452b54e200acf62343c3f44c45e03f8035cfeb56197e85b56a28524631db931
BLAKE2b-256 checksum
How to use checksums
daa6a6f41c6df9813eb038bcd14d04fede52e8c265bbee5eb90372f4dca38efe
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.3-py3-none-any.whl

Download URL ocr_stream-2.6.3-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55b262f0194f6ac47e3dee07cc87751a00e63975222ec26543348be917e730bf
BLAKE2b-256 checksum
How to use checksums
742ac0c23956cd6aa4d6fb2b13c6eb06caebfeeae6765477420e50581b719673
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.3

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