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.1.2.tar.gz (5.2 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.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: weml_validator-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for weml_validator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 17c9e857bfd4f11af687f39369f1aa00a2d8f356880b578aa6c555426bb6d35f
MD5 b1b9e2267f9b1ff087dba0a78d065b9d
BLAKE2b-256 3e5230750d616ba26180a06155a5b480bf43184d80608e11561647761e6a69e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: weml_validator-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for weml_validator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68faa480b7737f9d820cf62abcd594fb47ffc1fd4e0590904b4b02fed7c382c1
MD5 7b3552b7e68af8b645c436a3c31a22bc
BLAKE2b-256 8149378d9b6be1e3efb77c2165c4936c6036b7af316f6d01001af66a48810c99

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