httk.core.validation¶
Syntax validation predicates for IRIs and URLs.
Submodules¶
Functions¶
|
Return whether every |
|
Return whether value is a minimally well-formed absolute IRI. |
|
Return whether value is a minimally well-formed absolute HTTPS URL. |
|
Return whether value is a minimally well-formed root-relative URL. |
Package Contents¶
- httk.core.validation.has_valid_percent_escapes(value)[source]¶
Return whether every
%in value introduces a valid percent-escape.Each
%must be followed by exactly two hexadecimal digits, including when the%sits at the end of the string, where the missing followers make the escape invalid.
- httk.core.validation.is_absolute_iri(value)[source]¶
Return whether value is a minimally well-formed absolute IRI.
The check rejects whitespace, control characters, the C1 range, lone surrogates, the ASCII set
<>"{}|\^`, and malformed percent-escapes, then requires a non-empty URL scheme.
- httk.core.validation.is_https_url(value, *, allow_query=False)[source]¶
Return whether value is a minimally well-formed absolute HTTPS URL.
The value must be a well-formed absolute IRI whose scheme is exactly
https, with a non-empty host, no userinfo, and no fragment; any explicit port must lie in1..65535. A non-empty query is rejected unless allow_query isTrue.