Skip to main content

Extrair textos de documentos digitalizados e imagens.

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocr_stream-2.3.8.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocr_stream-2.3.8-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file ocr_stream-2.3.8.tar.gz.

File metadata

  • Download URL: ocr_stream-2.3.8.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for ocr_stream-2.3.8.tar.gz
Algorithm Hash digest
SHA256 739095a62efc03d9733d2de2af46a1327765fb29d9aab7c78b176097fbead937
MD5 59e23906690e1900fa1014bec7de0039
BLAKE2b-256 c3ad617a1dd08285cc5129817fc0d23907698336cb78448dfe877b8eead031f6

See more details on using hashes here.

File details

Details for the file ocr_stream-2.3.8-py3-none-any.whl.

File metadata

  • Download URL: ocr_stream-2.3.8-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for ocr_stream-2.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 546de83a556d8144860b65456a0a501b3437c946c7dfa8ca90cca5e5028c0203
MD5 a948d14f4a192ec4ca0cf561d539a58c
BLAKE2b-256 64763c42c4db776236b3445dbc7c33384eb2f489fc1f36f5fc8553031f941b78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page