class GeoIP2: (source)
Undocumented
Class Method | open |
Undocumented |
Method | __del__ |
Undocumented |
Method | __init__ |
Initialize the GeoIP object. No parameters are required to use default settings. Keyword arguments may be passed in to customize the locations of the GeoIP datasets. |
Method | __repr__ |
Undocumented |
Method | city |
Return a dictionary of city information for the given IP address or Fully Qualified Domain Name (FQDN). Some information in the dictionary may be undefined (None). |
Method | coords |
Undocumented |
Method | country |
Return a dictionary with the country code and name when given an IP address or a Fully Qualified Domain Name (FQDN). For example, both '24.124.1.80' and 'djangoproject.com' are valid parameters. |
Method | country |
Return the country code for the given IP Address or FQDN. |
Method | country |
Return the country name for the given IP Address or FQDN. |
Method | geos |
Return a GEOS Point object for the given query. |
Method | lat |
Return a tuple of the (latitude, longitude) for the given query. |
Method | lon |
Return a tuple of the (longitude, latitude) for the given query. |
Constant | MODE |
Undocumented |
Constant | MODE |
Undocumented |
Constant | MODE |
Undocumented |
Constant | MODE |
Undocumented |
Constant | MODE |
Undocumented |
Class Variable | cache |
Undocumented |
Property | info |
Return information about the GeoIP library and databases in use. |
Method | _check |
Check the query and database availability. |
Instance Variable | _city |
Undocumented |
Instance Variable | _city |
Undocumented |
Instance Variable | _country |
Undocumented |
Instance Variable | _country |
Undocumented |
Property | _country |
Undocumented |
Property | _reader |
Undocumented |
Initialize the GeoIP object. No parameters are required to use default settings. Keyword arguments may be passed in to customize the locations of the GeoIP datasets. * path: Base directory to where GeoIP data is located or the full path to where the city or country data files (*.mmdb) are located. Assumes that both the city and country data sets are located in this directory; overrides the GEOIP_PATH setting. * cache: The cache settings when opening up the GeoIP datasets. May be an integer in (0, 1, 2, 4, 8) corresponding to the MODE_AUTO, MODE_MMAP_EXT, MODE_MMAP, MODE_FILE, and MODE_MEMORY, `GeoIPOptions` C API settings, respectively. Defaults to 0, meaning MODE_AUTO. * country: The name of the GeoIP country data file. Defaults to 'GeoLite2-Country.mmdb'; overrides the GEOIP_COUNTRY setting. * city: The name of the GeoIP city data file. Defaults to 'GeoLite2-City.mmdb'; overrides the GEOIP_CITY setting.
Return a dictionary of city information for the given IP address or Fully Qualified Domain Name (FQDN). Some information in the dictionary may be undefined (None).
Return a dictionary with the country code and name when given an IP address or a Fully Qualified Domain Name (FQDN). For example, both '24.124.1.80' and 'djangoproject.com' are valid parameters.