New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kiwanocr

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kiwanocr

OCR single or multiple files

  • 0.0.8
  • PyPI
  • Socket score

Maintainers
1

KiwanOCR

This package takes a single PDF file or a list of PDF files and returns their content as a text file.

Kiwano fruit image

  • Requirements
  • Methods

Requirements

pip install or brew install

Make sure you have installed these dependencies:

  • brew install tesseract
  • brew install poppler
  • pip pdf2images

import

Import the following:

  • from PIL import Image
  • import pytesseract ## python interface for tesseract
  • import os ## navitage, create directories
  • import shutil ## to delete the image folders with their imgs
  • from pdf2image import convert_from_path ## to turn pdf to image
  • import glob ## to glob files into a list
  • from pathlib import Path ## to specify path to your files
  • from natsort import natsorted, ns ## natural sorting
  • import re ## for regex

Methods

Setup

  1. pip install kiwanocr.
  2. 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-langs to 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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc