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
- virtualenv .venv -p /usr/bin/python3.8 # provide virtualenv path to 3.8 interpreter
- source .venv/bin/activate # activate .venv virtual environment
- pip install -r requirements.txt # install dependencies
- python setup.py develop # provide a link to dev version of hocron
- 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)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99df7e28a364a4cf5735f7b2e3a9f6d6df7dc2003244804186f2a2b7a68908af |
|
MD5 | 8f58fe98b11be73974e26f949b464930 |
|
BLAKE2b-256 | b9920146114ab7f7c5a578cf0f425efbad72da1f7f357337608ee4e4f4664db0 |