
    .h                     j    S SK rS SKJr  S SKJr  S SKJrJr  S SK	J
r
  S SKJrJr  Sr " S S	\5      rg)
    N)partial)	urlencode)DEFAULT_SENTINELGeocoder)Location)join_filterlogger)Geolakec                   j   ^  \ rS rSrSr1 SkrSrSS\\S\SS.U 4S jjrSS	\S
.S jr	S r
S rSrU =r$ )r
      zGeocoder using the Geolake API.

Documentation at:
    https://geolake.com/docs/api

Terms of Service at:
    https://geolake.com/terms-of-use
>   citystatestreetaddresscountryzipcode	subNumberhouseNumberz/v1/geocodezapi.geolake.comN)domainschemetimeoutproxies
user_agentssl_contextadapter_factoryc          	         > [         T	U ]  UUUUUUS9  Xl        UR                  S5      U l        U R
                  < SU R                  < U R                  < 3U l        g)a*  

:param str api_key: The API key required by Geolake
    to perform geocoding requests. You can get your key here:
    https://geolake.com/

:param str domain: Currently it is ``'api.geolake.com'``, can
    be changed for testing purposes.

:param str scheme:
    See :attr:`geopy.geocoders.options.default_scheme`.

:param int timeout:
    See :attr:`geopy.geocoders.options.default_timeout`.

:param dict proxies:
    See :attr:`geopy.geocoders.options.default_proxies`.

:param str user_agent:
    See :attr:`geopy.geocoders.options.default_user_agent`.

:type ssl_context: :class:`ssl.SSLContext`
:param ssl_context:
    See :attr:`geopy.geocoders.options.default_ssl_context`.

:param callable adapter_factory:
    See :attr:`geopy.geocoders.options.default_adapter_factory`.

    .. versionadded:: 2.0

)r   r   r   r   r   r   /z://N)super__init__api_keystripr   r   api_pathapi)
selfr    r   r   r   r   r   r   r   	__class__s
            jC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\geopy/geocoders/geolake.pyr   Geolake.__init__#   s[    V 	!#+ 	 	
 ll3'"&++t{{DMMJ    T)country_codesexactly_oner   c                l   [        U[        R                  R                  5      (       aE  UR	                  5        VVs0 s H  u  pVXPR
                  ;   d  M  XV_M     nnnU R                  US'   OU R                  US.nU(       d  / n[        U[        5      (       a  U/nU(       a  SR                  U5      US'   SR                  U R                  [        U5      45      n[        R                  " SU R                  R                  U5        [        U R                   US9n	U R#                  XUS9$ s  snnf )	aS  
Return a location point by address.

:param query: The address or query you wish to geocode.

    For a structured query, provide a dictionary whose keys
    are one of: `country`, `state`, `city`, `zipcode`, `street`, `address`,
    `houseNumber` or `subNumber`.
:type query: str or dict

:param country_codes: Provides the geocoder with a list
    of country codes that the query may reside in. This value will
    limit the geocoder to the supplied countries. The country code
    is a 2 character code as defined by the ISO-3166-1 alpha-2
    standard (e.g. ``FR``). Multiple countries can be specified with
    a Python list.

:type country_codes: str or list

:param bool exactly_one: Return one result or a list of one result.

:param int timeout: Time, in seconds, to wait for the geocoding service
    to respond before raising a :class:`geopy.exc.GeocoderTimedOut`
    exception. Set this only if you wish to override, on this call
    only, the value set during the geocoder's initialization.

:rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
    ``exactly_one=False``.

r    )r    q,countryCodes?z%s.geocode: %s)r*   )r   )
isinstancecollectionsabcMappingitemsstructured_query_paramsr    strjoinr#   r   r	   debugr%   __name__r   _parse_json_call_geocoder)
r$   queryr)   r*   r   keyvalparamsurlcallbacks
             r&   geocodeGeolake.geocode[   s   N e[__4455 ;;= ! C666     !%F9  <<F
 MmS))*OM%(XXm%<F>"hh)F"345%t~~'>'>D4++E""3'"BB1s   D0D0c                     UR                  S5      (       d  gUS   nUS   nU R                  U5      n[        XSU4U5      nU(       a  U$ U/$ )z7Returns location, (latitude, longitude) from json feed.successNlatitude	longitude)get_get_addressr   )r$   pager*   rF   rG   r   results          r&   r:   Geolake._parse_json   sZ     xx	""
#%	##D)'i#8$?M8Or(   c                     UR                  S5      nUR                  S5      nUR                  S5      n[        SX4/5      nU$ )zL
Returns address string from page dictionary
:param page: dict
:return: str
placer   countryCodez, )rH   r   )r$   rJ   rN   address_cityaddress_country_coder   s         r&   rI   Geolake._get_address   sC     !yy($yy7d\$HIr(   )r#   r    r   )r9   
__module____qualname____firstlineno____doc__r5   r"   r   r   rB   r:   rI   __static_attributes____classcell__)r%   s   @r&   r
   r
      s]    	 H %$$( 6K 6Kx $@CD 
 
r(   r
   )collections.abcr1   	functoolsr   urllib.parser   geopy.geocoders.baser   r   geopy.locationr   
geopy.utilr   r	   __all__r
    r(   r&   <module>ra      s*      " ; # *
kh kr(   