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.1.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.1.tar.gz.
File metadata
- Download URL: weml_validator-0.1.1.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 |
db93b8b003c8fe33645c986912cd35c0d9f74a29124c8c88c7e12433a2d8123b
|
|
| MD5 |
732fe75211e4fda7db7b6c5c4a501eeb
|
|
| BLAKE2b-256 |
8844c6c66212ae54335cd6e95d212ba7c7a666555b979f6367223f0cae01b576
|
File details
Details for the file weml_validator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: weml_validator-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49e55cacb22866a557674b3d6916ac1f73cba03af6d0465fbe4c17bfe9ea68fe
|
|
| MD5 |
9cebec6d10e162cc9c68859b7667ffae
|
|
| BLAKE2b-256 |
963644613a009942b32d7d581a8d662e7cbfc9530a37318f967f681c5b5f9ebb
|