Skip to contents

Host Normalization

Entry point for UTS#46 IDNA host normalization — maps a hostname to a canonical lowercase ASCII comparison form.

host_normalize()
Normalize hosts to canonical comparison form
normalization_profile_info()
Canonical-host normalization profile identity

Punycode Codec

Low-level RFC 3492 encoder/decoder for individual domain labels (xn-- ASCII-Compatible Encoding).

puny_encode()
Encode Unicode domain labels to ASCII Punycode (low-level)
puny_decode()
Decode ASCII Punycode to Unicode domain labels (low-level)

Validators

Predicates for classifying domain names and labels.

validate_domain()
Comprehensive domain name validation
is_idn()
Test if domain contains internationalized characters
is_punycode()
Test if string is punycode encoded

Deprecated URL Helpers

Best-effort URL host extraction and rewriting. Deprecated in favour of dedicated URL packages.

url_encode()
Best-effort host rewriting in a URL-shaped string (Unicode host to ASCII)
url_decode()
Best-effort host rewriting in a URL-shaped string (ASCII punycode to Unicode)
parse_url()
Best-effort host extraction from a URL-shaped string

Internals

S3 print methods and package overview.

punycoder punycoder-package
Unicode and Punycode Domain Name Processing
print(<punycoder_parsed_url>)
Print method for punycoder parsed URL results
print(<punycoder_validation>)
Print method for punycoder validation results