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.3.tar.gz
(5.3 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.3.tar.gz.
File metadata
- Download URL: weml_validator-0.1.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
766f9cb8dd5f97cb1bb7809cb5ed73bb95b6b34608ff2fb5cbb1cb87746996d5
|
|
| MD5 |
d21993cdd757b0cd5161b18291edaa78
|
|
| BLAKE2b-256 |
dd53ec4c32b4c07b147341dda1563f81d03a80e118764217448f1dfe3eb6e64f
|
File details
Details for the file weml_validator-0.1.3-py3-none-any.whl.
File metadata
- Download URL: weml_validator-0.1.3-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 |
1e7167a8f35e04200d4540f780153cc9a007bb0ff35f104fc911393220f9f0f4
|
|
| MD5 |
9a2de6ba73942deff3a1014257ed7409
|
|
| BLAKE2b-256 |
d6470e2da11834e0115bcbafb82a54c94f1f4c21c9a84c427827580ee90cef8f
|