from functools import reduce


def deep_get(dictionary, keys, default=None):

    """get the dot key's item in nested dict
       eg person = {'person':{'name':{'first':'John'}}}
       deep_get(person, "person.name.first") will output 'John'

       Args:
           dictionary (dict): The dict object to get keys
           keys (dict): The deep keys
           default (object): The return item if key not exists
       Returns:
           item: the item of the deep dot keys
    """
    return reduce(lambda d, key: d.get(key, default) \
        if isinstance(d, dict) else default, keys.split("."), dictionary)