Skip to main content

Validator for the WEML document format by EGW Writings

Project description

Python library for validation of WEML markup language

This library is a Python implementation of the WEML markup language. It is used to validate WEML files without accessing EGW Writings API.

Installation

pip install weml-validator

Usage

from weml_validator import validate_weml_paragraph, validate_weml_element, ValidationResult

sample_weml_element = '<w-text-block>text<w-lang lang="en">note</w-lang></w-text-block>'
sample_weml_paragraph = '<w-para><w-text-block>text</w-text-block></w-para>'


def print_result(result: ValidationResult):
    if result:
        print("IS VALID")
        return
    print("IS NOT VALID")
    for error in result.errors:
        print(f"{error.line}:{error.column} {error.message}")


print_result(validate_weml_element(sample_weml_element))
print_result(validate_weml_paragraph(sample_weml_paragraph))

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

weml_validator-0.2.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weml_validator-0.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file weml_validator-0.2.0.tar.gz.

File metadata

  • Download URL: weml_validator-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for weml_validator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 585b5168bd1d4d8489e7928d677667b8c8ed698f1bd969ace47b638775bcacc6
MD5 269b73434f630072039d1f17f909349d
BLAKE2b-256 bfb1d1b106f3650321c00a7fca0678183a2f45936ee359e81eefc6f329e77924

See more details on using hashes here.

File details

Details for the file weml_validator-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: weml_validator-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for weml_validator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9caa95acdd82f98851d425c9486afea470e8ae6e42e3c8e1cc110d16c90a672f
MD5 14e08382cc96109d22cf5808e2912459
BLAKE2b-256 f1760a2b2231da131aaacd1cf934995c4ed3ccc3e41effbcd550e1f29ca248f6

See more details on using hashes here.

Supported by

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