Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/geoip2/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/geoip2/__pycache__/models.cpython-35.pyc



�IX32�@s�dZddlmZddlZddlmZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de�Z
Gd
d�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZdS)a&
Models
======

These classes provide models for the data returned by the GeoIP2
web service and databases.

The only difference between the City and Insights model classes is which
fields in each record may be populated. See
http://dev.maxmind.com/geoip/geoip2/web-services for more details.

�)�ABCMetaN)�SimpleEqualityc@s1eZdZdZddd�Zdd�ZdS)�CountryaCModel for the GeoIP2 Precision: Country and the GeoIP2 Country database.

    This class provides the following attributes:

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    NcCs�|dkrdg}||_tjj||jdi��|_tjj||jdi��|_tjj||jdi��|_tjj	||jdi��|_
tjj|jdi��|_tjj
|jdi��|_||_dS)N�en�	continent�country�registered_country�represented_country�maxmind�traits)�_locales�geoip2�recordsZ	Continent�getrrrrZRepresentedCountryr	ZMaxMindr
ZTraitsr�raw)�self�raw_response�locales�r�>/opt/alt/python35/lib/python3.5/site-packages/geoip2/models.py�__init__Ds 			!!zCountry.__init__c	Cs1djd|jd|jjd|jd|j�S)Nz({module}.{class_name}({data}, {locales})�module�
class_name�datar)�format�
__module__�	__class__�__name__rr)rrrr�__repr__]s
			zCountry.__repr__)rr�__qualname__�__doc__rrrrrrrs.rcs+eZdZdZd�fdd�Z�S)�Citya�Model for the GeoIP2 Precision: City and the GeoIP2 City database.

    .. attribute:: city

      City object for the requested IP address.

      :type: :py:class:`geoip2.records.City`

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: location

      Location object for the requested IP address.

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: subdivisions

      Object (tuple) representing the subdivisions of the country to which
      the location of the requested IP address belongs.

      :type: :py:class:`geoip2.records.Subdivisions`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    Ncs�tt|�j||�tjj||jdi��|_tjj|jdi��|_tjj	|jdi��|_
tjj||jdg��|_dS)N�city�location�postal�subdivisions)
�superr!rr
rrr"ZLocationr#ZPostalr$ZSubdivisionsr%)rrr)rrrr�s$!!z
City.__init__)rrrr rrr)rrr!es=r!c@seZdZdZdS)�Insightsa�Model for the GeoIP2 Precision: Insights web service endpoint.

    .. attribute:: city

      City object for the requested IP address.

      :type: :py:class:`geoip2.records.City`

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: location

      Location object for the requested IP address.

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: subdivisions

      Object (tuple) representing the subdivisions of the country to which
      the location of the requested IP address belongs.

      :type: :py:class:`geoip2.records.Subdivisions`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    N)rrrr rrrrr'�s=r'c@seZdZdZdS)�
Enterprisea�Model for the GeoIP2 Enterprise database.

    .. attribute:: city

      City object for the requested IP address.

      :type: :py:class:`geoip2.records.City`

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: location

      Location object for the requested IP address.

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: subdivisions

      Object (tuple) representing the subdivisions of the country to which
      the location of the requested IP address belongs.

      :type: :py:class:`geoip2.records.Subdivisions`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    N)rrrr rrrrr(�s=r(c@s(eZdZdZeZdd�ZdS)�SimpleModelz.Provides basic methods for non-location modelscCs.djd|jd|jjdt|j��S)Nz{module}.{class_name}({data})rrr)rrrr�strr)rrrrr6s		zSimpleModel.__repr__N)rrrr rZ
__metaclass__rrrrrr)1sr)c@s"eZdZdZdd�ZdS)�AnonymousIPa.Model class for the GeoIP2 Anonymous IP.

    This class provides the following attribute:

    .. attribute:: is_anonymous

      This is true if the IP address belongs to any sort of anonymous network.

      :type: bool

    .. attribute:: is_anonymous_vpn

      This is true if the IP address belongs to an anonymous VPN system.

      :type: bool

    .. attribute:: is_hosting_provider

      This is true if the IP address belongs to a hosting provider.

      :type: bool

    .. attribute:: is_public_proxy

      This is true if the IP address belongs to a public proxy.

      :type: bool

    .. attribute:: is_tor_exit_node

      This is true if the IP address is a Tor exit node.

      :type: bool

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode
    cCs�|jdd�|_|jdd�|_|jdd�|_|jdd�|_|jdd�|_|jd�|_||_dS)N�is_anonymousF�is_anonymous_vpn�is_hosting_provider�is_public_proxy�is_tor_exit_node�
ip_address)rr,r-r.r/r0r1r)rrrrrrhszAnonymousIP.__init__N)rrrr rrrrrr+>s(r+c@s"eZdZdZdd�ZdS)�ConnectionTypea�Model class for the GeoIP2 Connection-Type.

    This class provides the following attribute:

    .. attribute:: connection_type

      The connection type may take the following values:

      - Dialup
      - Cable/DSL
      - Corporate
      - Cellular

      Additional values may be added in the future.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode
    cCs1|jd�|_|jd�|_||_dS)N�connection_typer1)rr3r1r)rrrrrr�szConnectionType.__init__N)rrrr rrrrrr2ssr2c@s"eZdZdZdd�ZdS)�DomainaModel class for the GeoIP2 Domain.

    This class provides the following attribute:

    .. attribute:: domain

      The domain associated with the IP address.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode

    cCs1|jd�|_|jd�|_||_dS)N�domainr1)rr5r1r)rrrrrr�szDomain.__init__N)rrrr rrrrrr4�sr4c@s"eZdZdZdd�ZdS)�ISPa�Model class for the GeoIP2 ISP.

    This class provides the following attribute:

    .. attribute:: autonomous_system_number

      The autonomous system number associated with the IP address.

      :type: int

    .. attribute:: autonomous_system_organization

      The organization associated with the registered autonomous system number
      for the IP address.

      :type: unicode

    .. attribute:: isp

      The name of the ISP associated with the IP address.

      :type: unicode

    .. attribute:: organization

      The name of the organization associated with the IP address.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode
    cCsg|jd�|_|jd�|_|jd�|_|jd�|_|jd�|_||_dS)N�autonomous_system_number�autonomous_system_organization�isp�organizationr1)rr7r8r9r:r1r)rrrrrr�szISP.__init__N)rrrr rrrrrr6�s#r6)r �abcrZgeoip2.recordsr
Z
geoip2.mixinsrrr!r'r(r)r+r2r4r6rrrr�<module>sQL@@
5