HTML5Validate
HTML5 text validation, provided by HTML5lib. Designed to integrate easily in django or other web development environments, to ensure templates actually render as intented, without dangling tags, or other nonsense.
Currently just uses HTML5lib’s parsing and linting, which is enough for me right now - it would be nice to have some more comprehensive checking, and possibly even write some valid-attribute checking - although that’s a BIG project.
Usage:
>>> from html5validate import validate
>>> validate('<!doctype html><html><body><h1>Hi World!</h1></body></html>')
None
>>> validate('<!doctype html><html><body><h1>Hi World!</body></html>')
Traceback (most recent call last):
...
html5lib.html5parser.ParseError: Expected closing tag. Unexpected end of file.
So. You run ‘validate’ on some text, and it either returns None, or throws some kind of error at you.
With Django in tests:
from django.test import TestCase
from html5validate import validate
class TestIndexViewValid(TestCase):
def test_basic_index(self):
validate(self.client.get(reverse('index'), follow=True))
Status:
Very Early - I just pulled this out of some django view testing code in one of my other projects, as it seemed more sensible to have it as a stand-alone library that could be unit-tested and stuff, and I can use again easily.
Initial basic tests are here - but it should really have a LOT of tests written.
Roadmap:
Write a bunch of tests to see how strict it really is.
Write some extra tree walkers and checkers to look for valid tags, and throw some decent exceptions, and have customisability, specify what tags users want, etc.
Metadata
Release files for html5validate 0.0.2
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 |
|---|---|---|---|---|
| html5validate-0.0.2.tar.gz | 3.5 kB | Without provenance | Details for html5validate-0.0.2.tar.gz |
Release files / html5validate-0.0.2.tar.gz
| Download URL | html5validate-0.0.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13a2b743f7d5e92c6cb6e5ae440d0eab9d5f9a384c9e9b9a23a0d5a7d8df1519
|
|
BLAKE2b-256 checksum How to use checksums |
3fc0396e5ef2718404e447fe1bef077e4f636cdfaf1e08fc1c4d7853d6683d2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0
|
Security for html5validate 0.0.2
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.