class_docstr: Geocoder using the OpenCageData API.
  
  Documentation at:
      https://opencagedata.com/api
  
  .. versionchanged:: 2.2
      Improved error handling by using the default errors map
      (e.g. to raise :class:`.exc.GeocoderQuotaExceeded` instead of
      :class:`.exc.GeocoderQueryError` for HTTP 402 error)
class_docstr_tok: ["Geocoder","using","the","OpenCageData","API",".","Documentation","at",":","https",":","\/\/opencagedata.com\/api","..","versionchanged",":",":","2.2","Improved","error","handling","by","using","the","default","errors","map","(","e.g",".","to","raise",":","class",":","`",".exc.GeocoderQuotaExceeded","`","instead","of",":","class",":","`",".exc.GeocoderQueryError","`","for","HTTP","402","error",")"]
docstr: :param str api_key: The API key required by OpenCageData
      to perform geocoding requests. You can get your key here:
      https://opencagedata.com/
  
  :param str domain: Currently it is ``'api.opencagedata.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
docstr_tok: [":","param","str","api_key",":","The","API","key","required","by","OpenCageData","to","perform","geocoding","requests",".","You","can","get","your","key","here",":","https",":","\/\/opencagedata.com\/",":","param","str","domain",":","Currently","it","is","``","'api.opencagedata.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"]
code: def __init__(
      self,
      api_key,
      *,
      domain="api.opencagedata.com",
      scheme=None,
      timeout=DEFAULT_SENTINEL,
      proxies=DEFAULT_SENTINEL,
      user_agent=None,
      ssl_context=DEFAULT_SENTINEL,
      adapter_factory=None,
  ):
      """
  
      :param str api_key: The API key required by OpenCageData
          to perform geocoding requests. You can get your key here:
          https://opencagedata.com/
  
      :param str domain: Currently it is ``'api.opencagedata.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
      """
      super().__init__(
          scheme=scheme,
          timeout=timeout,
          proxies=proxies,
          user_agent=user_agent,
          ssl_context=ssl_context,
          adapter_factory=adapter_factory,
      )
  
      self.api_key = api_key
      self.domain = domain.strip("/")
      self.api = "%s://%s%s" % (self.scheme, self.domain, self.api_path)
  
file_path: geopy/geopy/geocoders/opencage.py
imports: from functools import partial
  from urllib.parse import urlencode
  from geopy.exc import GeocoderServiceError
  from geopy.geocoders.base import DEFAULT_SENTINEL, ERROR_CODE_MAP, Geocoder
  from geopy.location import Location
  from geopy.util import logger
label_desc: Use image node_id 1 to create a new OpenCage object from inherited base classes: Geocoder with example: obj = OpenCage(api_key)