Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Yet Another PDF OCR Tool

Project Description
yapot
=====

Yet Another PDF OCR Tool


This is a library (tool) that makes PDF -> Text as easy as possble by doing a lot of the hard stuff for you!

You will need ImageMagick, Tesseract, and QPDF to use yapot.

Ubuntu
------
> sudo apt-get install imagemagick libmagickcore-dev
> sudo apt-get install tesseract-ocr
> sudo apt-get install qpdf

To use yapot, do the following:

> pip install yapot

Then some code:

from yapot import convert_document

success, pdf_text = convert_document('file.pdf')

if success == True:
with open('file.txt', 'w') as f:
f.write(pdf_text)
else:
print "Unable to convert PDF!"

It's that simple!

Some more advanced things you can do are set the resolution, page delineation, and tell yapot not to delete temporary files (this can be useful when debugging nasty pdf's).

success, pdf_text = yapot.convert_document(
pdf_filename = pdf_filename, # The name of the pdf file
resolution = 200, # Image DPI resolution
delete_files = True, # delete temporary files
page_delineation = '\n--------\n', # page deination text
verbose = False, # output verbosity
temp_dir = str(uuid.uuid4()), # location of temp directory to use
password = '', # password for PDF file
make_thumbs = True, # create thrumbnails for each page
thumb_size = 512, # width of thumbnail image
thumb_dir = './thumbs', # directory to place thumbnails
thumb_prefix = 'thumb_page_', # prefix for thumbnail images
)
Release History

Release History

This version
History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.0

History Node

0.2.0

History Node

0.1.2

History Node

0.1.1.dev31

History Node

0.1.0

History Node

0.1.0.dev30

History Node

0.0.6.dev29

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

History Node

0.0.6.dev27.g940c607

History Node

0.0.6.dev25.g29a9424

History Node

0.0.5.dev21.gb6f158a

History Node

b6f158a

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
yapot-0.4.2.tar.gz (18.1 kB) Copy SHA256 Checksum SHA256 Source Sep 12, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting