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

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

Built distribution (wheel)

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

Total release size: 88.5 kB

Release files / ocr_stream-2.6.7.tar.gz

Download URL ocr_stream-2.6.7.tar.gz
Size 72.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4b700028b43eae2ff6588eb0ddab1bec01d8da3b2ef9fc410c84a6b25ff79a72
BLAKE2b-256 checksum
How to use checksums
9c2633c29ece97bf202667a7b774f0dd736a1944fe765d2ea85944ed8420f200
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.7-py3-none-any.whl

Download URL ocr_stream-2.6.7-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6836c83b48f524261f4ec00022b66e8c657f09b480f42735b08e7a0c0733be0e
BLAKE2b-256 checksum
How to use checksums
0a77afd7aa9d0fb91d4df4ed07f96bb5916c57c0287a1b13d42b3a505749ca52
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.7

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