1+ """
2+ Models
3+ ======
4+
5+ These classes provide models for the data returned by the GeoIP2
6+ Precision City end point.
7+
8+ The only difference between the City, City/ISP/Org, and Omni model classes is
9+ which fields in each record may be populated. See
10+ http://dev.maxmind.com/geoip/precision for more details.
11+
12+ """
113import geoip2 .records
214
315
416class Country (object ):
17+ """Model class for the GeoIP2 Precision Country end point
18+
19+ This class provides the following methods, each of which returns a record
20+ object.
21+
22+ :ivar continent: Returns a ``geoip2.records.Continent`` object
23+ representing continent data for the requested IP address.
24+ :ivar country: Returns a ``geoip2.recordsCountry`` object representing
25+ country data for the requested IP address. This record represents the
26+ country where MaxMind believes the IP is located in.
27+ :ivar registered_country: Returns a ``geoip2.recordsCountry`` object
28+ representing the registered country data for the requested IP address.
29+ This record represents the country where the ISP has registered a given
30+ IP block in and may differ from the user's country.
31+ :ivar traits: Returns ``a geoip2.records.Traits`` object representing
32+ the traits for the request IP address.
33+
34+ """
535 def __init__ (self , raw_response , languages = None ):
636 if languages is None :
737 languages = ['en' ]
@@ -20,6 +50,27 @@ def __init__(self, raw_response, languages=None):
2050
2151
2252class City (Country ):
53+ """Model class for the GeoIP2 Precision City end point
54+
55+ :ivar city: Returns a ``geoip2.records.City`` object representing
56+ country data for the requested IP address.
57+ :ivar continent: Returns a ``geoip2.records.Continent`` object
58+ representing continent data for the requested IP address.
59+ :ivar country: Returns a ``geoip2.recordsCountry`` object representing
60+ country data for the requested IP address. This record represents the
61+ country where MaxMind believes the IP is located in.
62+ :ivar location: Returns a ``geoip2.records.Location`` object
63+ representing country data for the requested IP address.
64+ :ivar region: Returns a ``geoip2.records.Region`` object representing
65+ country data for the requested IP address.
66+ :ivar registered_country: Returns a ``geoip2.recordsCountry`` object
67+ representing the registered country data for the requested IP address.
68+ This record represents the country where the ISP has registered a given
69+ IP block in and may differ from the user's country.
70+ :ivar traits: Returns ``a geoip2.records.Traits`` object representing
71+ the traits for the request IP address.
72+
73+ """
2374 def __init__ (self , raw_response , languages = None ):
2475 super (City , self ).__init__ (raw_response , languages )
2576 self .city = \
@@ -32,8 +83,48 @@ def __init__(self, raw_response, languages=None):
3283
3384
3485class CityISPOrg (City ):
35- pass
86+ """Model class for the GeoIP2 Precision City/ISP/Org end point
87+
88+ :ivar city: Returns a ``geoip2.records.City`` object representing
89+ country data for the requested IP address.
90+ :ivar continent: Returns a ``geoip2.records.Continent`` object
91+ representing continent data for the requested IP address.
92+ :ivar country: Returns a ``geoip2.recordsCountry`` object representing
93+ country data for the requested IP address. This record represents the
94+ country where MaxMind believes the IP is located in.
95+ :ivar location: Returns a ``geoip2.records.Location`` object
96+ representing country data for the requested IP address.
97+ :ivar region: Returns a ``geoip2.records.Region`` object representing
98+ country data for the requested IP address.
99+ :ivar registered_country: Returns a ``geoip2.recordsCountry`` object
100+ representing the registered country data for the requested IP address.
101+ This record represents the country where the ISP has registered a given
102+ IP block in and may differ from the user's country.
103+ :ivar traits: Returns ``a geoip2.records.Traits`` object representing
104+ the traits for the request IP address.
105+
106+ """
36107
37108
38109class Omni (CityISPOrg ):
39- pass
110+ """Model class for the GeoIP2 Precision Omni end point
111+
112+ :ivar city: Returns a ``geoip2.records.City`` object representing
113+ country data for the requested IP address.
114+ :ivar continent: Returns a ``geoip2.records.Continent`` object
115+ representing continent data for the requested IP address.
116+ :ivar country: Returns a ``geoip2.recordsCountry`` object representing
117+ country data for the requested IP address. This record represents the
118+ country where MaxMind believes the IP is located in.
119+ :ivar location: Returns a ``geoip2.records.Location`` object
120+ representing country data for the requested IP address.
121+ :ivar region: Returns a ``geoip2.records.Region`` object representing
122+ country data for the requested IP address.
123+ :ivar registered_country: Returns a ``geoip2.recordsCountry`` object
124+ representing the registered country data for the requested IP address.
125+ This record represents the country where the ISP has registered a given
126+ IP block in and may differ from the user's country.
127+ :ivar traits: Returns ``a geoip2.records.Traits`` object representing
128+ the traits for the request IP address.
129+
130+ """
0 commit comments