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

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.1
File Size Uploaded Provenance Actions
ocr_stream-2.6.1.tar.gz 76.5 kB Without provenance Details for ocr_stream-2.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 91.9 kB

Release files / ocr_stream-2.6.1.tar.gz

Download URL ocr_stream-2.6.1.tar.gz
Size 76.5 kB
Tags Source
SHA-256 checksum
How to use checksums
adfb35986c7e98afc98f648347707fa164e7bb8d53f8ac8b8c4344499e55bd81
BLAKE2b-256 checksum
How to use checksums
c0af9c8d581cd6c3197daecff8e7f3490a751e7d3d6fb1e553446a33aa57691e
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.1-py3-none-any.whl

Download URL ocr_stream-2.6.1-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dabe9a07740e52fa7c2e1192add70e310fff3891d40b1a529aa82998745a4610
BLAKE2b-256 checksum
How to use checksums
129f8c9b045594386783dd6231f62dc8475f12b41f47ceb9d3e7893e14311d44
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.1

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