def __init__(
            self,
            format_string=None,
            view_box=None,
            bounded=None,
            country_bias=None,
            timeout=DEFAULT_SENTINEL,
            proxies=DEFAULT_SENTINEL,
            domain=_DEFAULT_NOMINATIM_DOMAIN,
            scheme=None,
            user_agent=None,
            ssl_context=DEFAULT_SENTINEL,
            # Make sure to synchronize the changes of this signature in the
            # inheriting classes (e.g. PickPoint).
    ):
        """
        :param str format_string:
            See :attr:`geopy.geocoders.options.default_format_string`.

        :type view_box: list or tuple of 2 items of :class:`geopy.point.Point` or
            ``(latitude, longitude)`` or ``"%(latitude)s, %(longitude)s"``.
        :param view_box: Coordinates to restrict search within.
            Example: ``[Point(22, 180), Point(-22, -180)]``.

            .. versionchanged:: 1.15.0
                Previously only a list of stringified coordinates was supported.

            .. versionchanged:: 1.17.0
                Previously view_box could be a list of 4 strings or numbers
                in the format of ``[longitude, latitude, longitude, latitude]``.
                This format is now deprecated in favor of a list/tuple
                of a pair of geopy Points and will be removed in geopy 2.0.

            .. deprecated:: 1.19.0
                This argument will be removed in geopy 2.0.
                Use `geocode`'s `viewbox` instead.

        :param bool bounded: Restrict the results to only items contained
            within the bounding view_box.

            .. versionadded:: 1.15.0

            .. deprecated:: 1.19.0
                This argument will be removed in geopy 2.0.
                Use `geocode`'s `bounded` instead.

        :type country_bias: str or list
        :param country_bias: Limit search results to a specific country.
            This param sets a default value for the `geocode`'s ``country_codes``.

            .. deprecated:: 1.19.0
                This argument will be removed in geopy 2.0.
                Use `geocode`'s `country_codes` instead.

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

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

        :param str domain: Domain where the target Nominatim service
            is hosted.

            .. versionadded:: 1.8.2

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

            .. versionadded:: 1.8.2

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

            .. versionadded:: 1.12.0

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

            .. versionadded:: 1.14.0

        """
        super(Nominatim, self).__init__(
            format_string=format_string,
            scheme=scheme,
            timeout=timeout,
            proxies=proxies,
            user_agent=user_agent,
            ssl_context=ssl_context,
        )

        if country_bias is not None:
            warnings.warn(
                '`country_bias` argument of the %(cls)s.__init__ '
                'is deprecated and will be removed in geopy 2.0. Use '
                '%(cls)s.geocode(country_codes=%(value)r) instead.'
                % dict(cls=type(self).__name__, value=country_bias),
                DeprecationWarning,
                stacklevel=2
            )
        self.country_bias = country_bias

        if view_box is not None:
            warnings.warn(
                '`view_box` argument of the %(cls)s.__init__ '
                'is deprecated and will be removed in geopy 2.0. Use '
                '%(cls)s.geocode(viewbox=%(value)r) instead.'
                % dict(cls=type(self).__name__, value=view_box),
                DeprecationWarning,
                stacklevel=2
            )
        self.view_box = view_box

        if bounded is not None:
            warnings.warn(
                '`bounded` argument of the %(cls)s.__init__ '
                'is deprecated and will be removed in geopy 2.0. Use '
                '%(cls)s.geocode(bounded=%(value)r) instead.'
                % dict(cls=type(self).__name__, value=bounded),
                DeprecationWarning,
                stacklevel=2
            )
        self.bounded = bounded

        self.domain = domain.strip('/')

        if (self.domain == _DEFAULT_NOMINATIM_DOMAIN
                and self.headers['User-Agent'] == _DEFAULT_USER_AGENT):
            warnings.warn(
                'Using Nominatim with the default "%s" `user_agent` is '
                'strongly discouraged, as it violates Nominatim\'s ToS '
                'https://operations.osmfoundation.org/policies/nominatim/ '
                'and may possibly cause 403 and 429 HTTP errors. '
                'Please specify a custom `user_agent` with '
                '`Nominatim(user_agent="my-application")` or by '
                'overriding the default `user_agent`: '
                '`geopy.geocoders.options.default_user_agent = "my-application"`. '
                'In geopy 2.0 this will become an exception.'
                % _DEFAULT_USER_AGENT,
                DeprecationWarning,
                stacklevel=2
            )

        self.api = "%s://%s%s" % (self.scheme, self.domain, self.geocode_path)
        self.reverse_api = "%s://%s%s" % (self.scheme, self.domain, self.reverse_path)
def __init__ ( self , format_string = None , view_box = None , bounded = None , country_bias = None , timeout = DEFAULT_SENTINEL , proxies = DEFAULT_SENTINEL , domain = _DEFAULT_NOMINATIM_DOMAIN , scheme = None , user_agent = None , ssl_context = DEFAULT_SENTINEL , ) : super ( Nominatim , self ) . __init__ ( format_string = format_string , scheme = scheme , timeout = timeout , proxies = proxies , user_agent = user_agent , ssl_context = ssl_context , ) if country_bias is not None : warnings . warn ( '`country_bias` argument of the %(cls)s.__init__ ' 'is deprecated and will be removed in geopy 2.0. Use ' '%(cls)s.geocode(country_codes=%(value)r) instead.' % dict ( cls = type ( self ) . __name__ , value = country_bias ) , DeprecationWarning , stacklevel = 2 ) self . country_bias = country_bias if view_box is not None : warnings . warn ( '`view_box` argument of the %(cls)s.__init__ ' 'is deprecated and will be removed in geopy 2.0. Use ' '%(cls)s.geocode(viewbox=%(value)r) instead.' % dict ( cls = type ( self ) . __name__ , value = view_box ) , DeprecationWarning , stacklevel = 2 ) self . view_box = view_box if bounded is not None : warnings . warn ( '`bounded` argument of the %(cls)s.__init__ ' 'is deprecated and will be removed in geopy 2.0. Use ' '%(cls)s.geocode(bounded=%(value)r) instead.' % dict ( cls = type ( self ) . __name__ , value = bounded ) , DeprecationWarning , stacklevel = 2 ) self . bounded = bounded self . domain = domain . strip ( '/' ) if ( self . domain == _DEFAULT_NOMINATIM_DOMAIN and self . headers [ 'User-Agent' ] == _DEFAULT_USER_AGENT ) : warnings . warn ( 'Using Nominatim with the default "%s" `user_agent` is ' 'strongly discouraged, as it violates Nominatim\'s ToS ' 'https://operations.osmfoundation.org/policies/nominatim/ ' 'and may possibly cause 403 and 429 HTTP errors. ' 'Please specify a custom `user_agent` with ' '`Nominatim(user_agent="my-application")` or by ' 'overriding the default `user_agent`: ' '`geopy.geocoders.options.default_user_agent = "my-application"`. ' 'In geopy 2.0 this will become an exception.' % _DEFAULT_USER_AGENT , DeprecationWarning , stacklevel = 2 ) self . api = "%s://%s%s" % ( self . scheme , self . domain , self . geocode_path ) self . reverse_api = "%s://%s%s" % ( self . scheme , self . domain , self . reverse_path )
:param str format_string:
            See :attr:`geopy.geocoders.options.default_format_string`.

        :type view_box: list or tuple of 2 items of :class:`geopy.point.Point` or
            ``(latitude, longitude)`` or ``"%(latitude)s, %(longitude)s"``.
        :param view_box: Coordinates to restrict search within.
            Example: ``[Point(22, 180), Point(-22, -180)]``.

            .. versionchanged:: 1.15.0
                Previously only a list of stringified coordinates was supported.

            .. versionchanged:: 1.17.0
                Previously view_box could be a list of 4 strings or numbers
                in the format of ``[longitude, latitude, longitude, latitude]``.
                This format is now deprecated in favor of a list/tuple
                of a pair of geopy Points and will be removed in geopy 2.0.

            .. deprecated:: 1.19.0
                This argument will be removed in geopy 2.0.
                Use `geocode`'s `viewbox` instead.

        :param bool bounded: Restrict the results to only items contained
            within the bounding view_box.

            .. versionadded:: 1.15.0

            .. deprecated:: 1.19.0
                This argument will be removed in geopy 2.0.
                Use `geocode`'s `bounded` instead.

        :type country_bias: str or list
        :param country_bias: Limit search results to a specific country.
            This param sets a default value for the `geocode`'s ``country_codes``.

            .. deprecated:: 1.19.0
                This argument will be removed in geopy 2.0.
                Use `geocode`'s `country_codes` instead.

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

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

        :param str domain: Domain where the target Nominatim service
            is hosted.

            .. versionadded:: 1.8.2

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

            .. versionadded:: 1.8.2

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

            .. versionadded:: 1.12.0

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

            .. versionadded:: 1.14.0