Skip to main content

OCR App with API

The OCR app is an application for extracting text from images and PDF files. It is built on Flask, a Python web framework, and utilizes the Tesseract OCR library and the PIL library for image processing.

Features

API for the upload of images and PDF files for text extraction. Support for various image formats such as JPG, JPEG, PNG and PDF. Processing of PDF files by converting them into images and extracting text from the images. API access to the same texts.

Requirements

To run the app, the dependencies from requirements.txt must be installed:

Flask pytesseract Tesseract OCR PIL (Python Imaging Library) fitz You can install the dependencies with pip by running the following command:

pip install -r requirements.txt

Starting the Application

Run the app with the following command:

python app.py

The app will be started in test mode on http://localhost:5000.

API Access Guide

For API usage, a request can be sent for example as Python code with the path of the image in the following form:

url = 'http://localhost:5000/api_endpoint' image_path = '/image_path' files = {'image': open(image_path, 'rb')} response = requests.post(url, files=files)

Note: Make sure the app is running.

Instructions

Make sure the app is running in your webbrowser. Since no content is put on the homepage you will see a server error. To use the API send a request like in the request.py file, supplying your path to the image .

Note

Make sure that Tesseract OCR is installed on your system and the 'TESSDATA_PREFIX' environment variable is correctly set to the directory with the Tesseract language data.

Rechtliches

Medizinische Daten werden mit MedCat klassifiziert. Die Erstellung erfolgt unter Verwendung der maschinenlesbaren Fassung des Bundesinstituts für Arzneimittel und Medizinprodukte (BfArM).

Max Hild // AG Lux // 2023

Metadata

Release files for agl-ocr-reader 1.1.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 agl-ocr-reader 1.1.1
File Size Uploaded Provenance
agl_ocr_reader-1.1.1.tar.gz 1.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agl-ocr-reader 1.1.1
File Interpreter ABI Platform
agl_ocr_reader-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / agl_ocr_reader-1.1.1.tar.gz

Download URL agl_ocr_reader-1.1.1.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b75d978d9af63cc6f7f1c1ed09ae05bcd04012b85b26bf02a2b8320a53641d95
BLAKE2b-256 checksum
How to use checksums
00d79c2978244aa63a766f9f93714f6c2b295509a99bb219b319987f79e256a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.8 Darwin/22.5.0

Release files / agl_ocr_reader-1.1.1-py3-none-any.whl

Download URL agl_ocr_reader-1.1.1-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
72354bb5e3d2ffbc7548ba391e0efc9a9693f6ef6402d2a3a5154263c9013edb
BLAKE2b-256 checksum
How to use checksums
cd59e05ce0b86c4606607f89383f77383844b815887f1bc57d4071d4951456de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.8 Darwin/22.5.0

Security for agl-ocr-reader 1.1.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.

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files No provenance

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