Skip to main content

Provides an API layer over HOCR data format

Project description

Hocron

Hocron provides an API over HOCR file format.

Installation

pip install hocron

Prepare Development Environment & Run Tests

  1. virtualenv .venv -p /usr/bin/python3.8 # provide virtualenv path to 3.8 interpreter
  2. source .venv/bin/activate # activate .venv virtual environment
  3. pip install -r requirements.txt # install dependencies
  4. python setup.py develop # provide a link to dev version of hocron
  5. python test/run.py

Usage

Example:

from hocron import Hocron, LinePattern

# define a line pattern
line_pattern = LinePattern([
    'EUR',
    re.compile('\d+[\.,]+\d\d$')
])

hocron_inst = Hocron(hocr_as_str)

value = hocron_inst.get_labeled_value(line_pattern)

Hocron class receives as argument a string. It expects that string to in a valid hOCR format.

References

hOCR is an open standard of data representation for formatted text obtained from optical character recognition (OCR).

Project details


Download files

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

Source Distribution

hocron-0.5.0.tar.gz (18.4 kB view details)

Uploaded Source

File details

Details for the file hocron-0.5.0.tar.gz.

File metadata

  • Download URL: hocron-0.5.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.4

File hashes

Hashes for hocron-0.5.0.tar.gz
Algorithm Hash digest
SHA256 99df7e28a364a4cf5735f7b2e3a9f6d6df7dc2003244804186f2a2b7a68908af
MD5 8f58fe98b11be73974e26f949b464930
BLAKE2b-256 b9920146114ab7f7c5a578cf0f425efbad72da1f7f357337608ee4e4f4664db0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page