def import_object(name):
    """
    Import an object from a module, by name.

    :param name: The object name, in the ``package.module:name`` format.
    :return: The imported object
    """

    if name.count(':') != 1:
        raise ValueError("Invalid object name: {0!r}. "
                         "Expected format: '<module>:<name>'."
                         .format(name))

    module_name, class_name = name.split(':')
    module = __import__(module_name, fromlist=[class_name])
    return getattr(module, class_name)