assets_guardian.utils.ip๏ƒ

Functions

get_ip_location(ip_address)

Gets the location details of a given IP address.

get_my_ip()

Gets the public IP address of the current machine.

parse_ip(ip_str)

Parses an IP string into an IPv4Address or IPv6Address object.

assets_guardian.utils.ip.get_ip_location(ip_address: str) dict[str, Any][source]๏ƒ

Gets the location details of a given IP address.

Parameters:

ip_address โ€“ The IP address to locate.

Returns:

A dictionary containing the location details (ip, city, region, country).

Return type:

dict

assets_guardian.utils.ip.get_my_ip() str[source]๏ƒ

Gets the public IP address of the current machine.

Returns:

The public IP address.

Return type:

str

assets_guardian.utils.ip.parse_ip(ip_str: Any) IPv4Address | IPv6Address | None[source]๏ƒ

Parses an IP string into an IPv4Address or IPv6Address object.

Parameters:

ip_str โ€“ The IP address string.

Returns:

The parsed IP object, or None if invalid or empty.

Return type:

IPv4Address | IPv6Address | None