=====
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
)
Metadata
Release files for yapot 0.4.2
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 | Actions |
|---|---|---|---|---|
| yapot-0.4.2.tar.gz | 18.1 kB | Without provenance | Details for yapot-0.4.2.tar.gz |
Release files / yapot-0.4.2.tar.gz
| Download URL | yapot-0.4.2.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
116ac19749ae09a8be4dc26c77ccf4a6bbdd5671fbbdd128cfb5be267f0463a1
|
|
BLAKE2b-256 checksum How to use checksums |
358c315b4bd323a8678ef450e5c15b2703eaa167a43ec6b462ab503145da42a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for yapot 0.4.2
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.