duck.utils.net

Network helper utilily tools.

Module Contents

Functions

is_domain

Check if the provided name is a valid domain name.

is_ipv4

Check if the provided IP address is a valid IPv4 address.

is_ipv6

Check if the provided IP address is a valid IPv6 address.

is_valid_host

Super-fast validation of hostname or IP address, optionally with a port. Returns a tuple (is_valid, message).

Data

HOSTNAME_LABEL_RE

MAX_HOSTNAME_LENGTH

API

duck.utils.net.HOSTNAME_LABEL_RE

‘compile(…)’

duck.utils.net.MAX_HOSTNAME_LENGTH

253

duck.utils.net.is_domain(name) bool[source]

Check if the provided name is a valid domain name.

duck.utils.net.is_ipv4(ip_address: str) bool[source]

Check if the provided IP address is a valid IPv4 address.

duck.utils.net.is_ipv6(ip_address: str) bool[source]

Check if the provided IP address is a valid IPv6 address.

duck.utils.net.is_valid_host(host) Tuple[bool, str][source]

Super-fast validation of hostname or IP address, optionally with a port. Returns a tuple (is_valid, message).