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.0.tar.gz
(5.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file weml_validator-0.1.0.tar.gz.
File metadata
- Download URL: weml_validator-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fdf3b15743fb228beffa7fdb2e4059ab09cd030fe58e09d2fe6148cfc3e4375
|
|
| MD5 |
c27164ebb813c736eca84856ec4d763d
|
|
| BLAKE2b-256 |
14e8f3ebf02f8960b6d85f425449f021126a77d4db4e3f0c42f759d701cbe025
|
File details
Details for the file weml_validator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: weml_validator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc69df2b83d28a49929d587436a66b8bd8f0145478891213e07bd7e95ec4beb5
|
|
| MD5 |
785ddb6a5ea9d2d663f55616bebedb3c
|
|
| BLAKE2b-256 |
cef93d5167c55faaf191d95d78e8e95eae739d907c5ce50014f4c469fcfa2006
|