Skip to main content

HTRVX, HTR Validation with XSD

Project description

HTRVX : HTR Validation for eXtra-quality controlled documents

Test library

HTRVX - pronounced Ashterux - allows for quality control of XML using XSD schema validation, Segmonto validation and other verifications.

How to install

Simply run pip install htrvx

How to run

The basic way to run the script is htrvx PATHTOFILES --format FORMAT, eg. htrvx ./tests/test_data/page/*.xml --format page

Each verification is an opt-in verification: you need to express the fact that you want to check it.

  • --segmonto will check for Segmonto compliancy
  • --xsd will check if the data are compliant with XML Schemas
  • --check-empty will check if regions have no lines or if lines have no text
    • --check-empty can be refined with --raise-empty to throw an error if empty elements are found, otherwise it's simply reported.

Other parameters mainly have to do with verbosity: --verbose displays details about errors, --group groups errors (instead of showing one line per error, groups by error types).

Parameters Default Function
-v, --verbose False Prints more information
-f, --format [alto,page] ALTO Format of files
-s, --segmonto False Apply Segmonto Zoning verification
-e, --check-empty False Check for empty lines or empty zones
-r, --raise-empty False Warns but not fails if empty lines or empty zones are found
-x, --xsd False Apply XSD Schema verification
-g, --group False Group error types (reduce verbosity)

Github Action code

If you want to add this to your github repository, as a continuous integration workflow, add a file htrux.yml at in the path .github/workflows of your repository.

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: HTRVX

on: [push, pull_request] # You can edit this of course !

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install htrvx
    - name: Run HTRVX
      run: |
        htrvx --verbose --group --format alto --segmonto --xsd --check-empty --raise-empty UNIX/Path/to/**/your/*.xml

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

htrvx-0.0.8.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

htrvx-0.0.8-py2.py3-none-any.whl (56.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file htrvx-0.0.8.tar.gz.

File metadata

  • Download URL: htrvx-0.0.8.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for htrvx-0.0.8.tar.gz
Algorithm Hash digest
SHA256 826216b45167eb5df5596b7fd25bf0d69fcf90d02cb42c1e700ed64b1962ac28
MD5 92465ad4b0fdc9aeb47e68864c677f6d
BLAKE2b-256 7572bf5ee18db1ba18e6bb250cdac49dacbfdfba7b36c5d1194a5ce9769abf10

See more details on using hashes here.

File details

Details for the file htrvx-0.0.8-py2.py3-none-any.whl.

File metadata

  • Download URL: htrvx-0.0.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 56.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for htrvx-0.0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 aa678f501a98aec32d130c58bf12b0be896296f33badd622bb20846e04d9a987
MD5 47c3079b01e2909ec5662b17c980b728
BLAKE2b-256 76713539f1a35cbf4776083b4438f58ebc90245dec3362eb225e2d002422ba21

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