def get_recursive(d, names):
    """ Recursively get dictionary keys

    The ``names`` argument should be a list of keys from top level to bottom.

    Example::

        >>> get_recursive({'foo': 'bar', 'baz': {'fam': 12}}, ['baz', 'fam'])
        12

    """
    n = names.pop(0)
    if not names:
        return d[n]
    return get_recursive(d[n], names)