import json


def deep_dict(obj):
    """
    Serialize the Json, and then read it back as a dict.
    This casts the object to a dict, but does it recursively.

    You can cast an object to a dict with dict(), but that does not
    also convert sub-objects.
    :param obj: a datatructure likely containing Boto objects.
    :return: a dict where all branches or leaf nodes are either a
    python dict, list, or a primative such as int, boolean, basestr, or Nonetype
    """
    return json.loads(
        json.dumps(obj)
    )