KiwanOCR
This package takes a single PDF file or a list of PDF files and returns their content as a text file.
- Requirements
- Methods
Requirements
pip install or brew install
Make sure you have installed these dependencies:
brew install tesseractbrew install popplerpip pdf2images
import
Import the following:
from PIL import Imageimport pytesseract## python interface for tesseractimport os## navitage, create directoriesimport shutil## to delete the image folders with their imgsfrom pdf2image import convert_from_path## to turn pdf to imageimport glob## to glob files into a listfrom pathlib import Path## to specify path to your filesfrom natsort import natsorted, ns## natural sortingimport re## for regex
Methods
Setup
pip install kiwanocr.from kiwano import ocr
OCR a single PDF
ocr.ocr_file(file_name, output_file_name, language, resolution)
Arguments
- file_name: as a string
- output_file_name: as a string
- language: default is English (use
tesseract --list-langsto retrieve langague codes ) - resolution: default is 300 dpi (use integer value between 100 and 1200)
OCR a list of PDFs
ocr.ocr_files(list_name, output_file_name, language, resolution)
- list_name: The only difference is to enter a list name
Output
A .txt file is placed in a output folder.
Metadata
Release files for kiwanocr 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kiwanocr-0.0.8.tar.gz | 4.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kiwanocr-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / kiwanocr-0.0.8.tar.gz
| Download URL | kiwanocr-0.0.8.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6049a60278ae572874ee6d9f856ea1df7fcba4a2da5ea3d517ea19784194ba04
|
|
BLAKE2b-256 checksum How to use checksums |
ea91398502259fdad21ed2f213617190bf369598cc20be8b5b86501647df8564
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
|
Release files / kiwanocr-0.0.8-py3-none-any.whl
| Download URL | kiwanocr-0.0.8-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91bb93845ec98441c350c8a63415d99c0174687fff13fff700f369eb12a45c25
|
|
BLAKE2b-256 checksum How to use checksums |
ed65343f1a5f57290e34cca88e15b486d8ef6ebc59f43728687b69e054df531c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
|
Security for kiwanocr 0.0.8
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.