pip install py_w3c
Usage:
1. As library -
# import HTML validator
from py_w3c.validators.html.validator import HTMLValidator
# create validator instance
vld = HTMLValidator()
# validate
vld.validate('http://example.com')
# look for errors
print(vld.errors) # list with dicts
# look for warnings
print(vld.warnings)
There are 3 methods of validating:
1. validate url - HTMLValidator().validate(url)
2. validate file - HTMLValidator().validate_file(filename_or_file) # StringIO aware.
3. validate fragment - HTMLValidator().validate_fragment(fragment_string)
You can pass charset while creating validator instance. This will force validator to use passed charset for validation.
Example (python).
vld = HTMLValidator(charset='utf-8')
# now validator uses utf-8 charset ignoring charset in the document content
vld.validate('http://example.com')
2. As standalone script - (not very usefull right now)
Now only URL validating is allowed for standalone script.
$ w3c_validate http://example.com
Prints warnings and errors to the console.
Running tests.
$ python setup.py test
This command will install tox and run tests for py2.7 and py3.4.
To run test for one python version use (py2.7 for example):
$ python setup.py test -a "-epy27"
Metadata
Release files for py_w3c 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_w3c-0.3.1.tar.gz | 6.5 kB | Without provenance | Details for py_w3c-0.3.1.tar.gz |
Release files / py_w3c-0.3.1.tar.gz
| Download URL | py_w3c-0.3.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b643360fb2bf8fe87d7dc566c426a3417bfc09616b79966092fa0ecfabe92e83
|
|
BLAKE2b-256 checksum How to use checksums |
a5efb45913e890e0db1c0f498aa4f2369561e120a26a77d2b073979b5fe7a004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for py_w3c 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.