assets_guardian.utils.ip๏
Functions
|
Gets the location details of a given IP address. |
Gets the public IP address of the current machine. |
|
|
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