API reference

PyMmdbServer

class pymmdbserver.PyMmdbServer(root_url: str = 'https://ip.circl.lu/', useragent: str | None = None, *, proxies: dict[str, str] | None = None)
geolookup(ip: str) list[dict[str, Any]]

Get the geolocation of a specific IP address.

Parameters:

ip – The IP address to look up.

Returns:

A dictionary with the geolocation information.

property is_up: bool

Test if the given instance is accessible

my_geolookup() list[dict[str, Any]]

Get the geolocation of the IP address of the client making the request.

Returns:

A dictionary with the geolocation information.

my_ip() str

Only return the IP address of the client making the request.

Returns:

The IP address, as a string.