import importlib


def get_driver(driver_class):
  """
  Get Python class, implementing device driver, by its name.

  :param str driver_class: path to a class, e.g. ``ducky.devices.rtc.RTC``.
  :returns: driver class.
  """

  driver = driver_class.split('.')

  driver_module = importlib.import_module('.'.join(driver[0:-1]))
  driver_class = getattr(driver_module, driver[-1])

  return driver_class