Network

Network utility functions.

is_loopback_address(address)[source]

Determine whether an address is a loopback address (e.g. 127.0.0.1).

Parameters

address (str) – Address (can be IP or IP:port)

Returns

Boolean

is_local_address(address)[source]

Determine whether an address is a local (including loopback) IP address.

Adapted from stackoverflow.com/questions/166506.

Parameters

address (str) – Address (can be IP or IP:port)

Returns

Boolean