Skip to main content

HOCkeR

Python package for combining hOCR files and images into searchable PDFs

Table of Contents

  1. What is hoCKeR?
  2. How to install
  3. How to Use
  4. Credits

What is hOCkeR?

HOCkeR is a Python package for combining hOCR files and images into searchable PDFs. The package lays the text on top of the image, and then creates a PDF with the text and image. The code used is from HOCRConverter by jbrinley. The code was designed for Python 2, therefore does not work with newer version of python, so I created this package as an update to the original code.

How to install

To install the package, run the following command within a python environment:

pip install hocker

If any errors occur whilst installing, try using the .whl file instead linked here

How to use hOCkeR

Below is an example of how to use hOCkeR to combine an png and a .hocr file into a PDF

import hocker as hkr

image_path = 'path/to/image.png'
hocr_path = 'path/to/image.hocr'

# Specify the element in the hocr file to use as the text
hocr = hkr.HOCRCombiner('ocrx_word') # For tesseract outputs, it is 'ocrx_word'

# Specify the hocr and image path
hocr.locate_image(image_path)
hocr.locate_hocr(hocr_path)

# Output the PDF
hocr.to_pdf('path/to/output.pdf')

Metadata

Release files for hocker 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hocker 1.0.4
File Size Uploaded Provenance Actions
hocker-1.0.4.tar.gz 280.4 kB Without provenance Details for hocker-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hocker 1.0.4
File Interpreter ABI Platform Actions
hocker-1.0.4-py3-none-any.whl Python 3 none any Details for hocker-1.0.4-py3-none-any.whl

Total release size: 285.7 kB

Release files / hocker-1.0.4.tar.gz

Download URL hocker-1.0.4.tar.gz
Size 280.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2886ccba7f5c7eca5c0ea4d98ac323f8c2da2c060b00f21361bbd8263dcf5c57
BLAKE2b-256 checksum
How to use checksums
ec2eec87c41d23a94cd257cc94a2c92cd08feaf15e5a79915d046c69c5749b38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / hocker-1.0.4-py3-none-any.whl

Download URL hocker-1.0.4-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4148b95bb2f5428f06d5186d0af2f18c2d29ebc46d34daf2edcc26aaf17e56dc
BLAKE2b-256 checksum
How to use checksums
24de8e0cbf53aa8a4e8239e54e813114d6a75398b0c06db40617c7dd9adebab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for hocker 1.0.4

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.

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