import json
import decimal


def decimal_decoder(json_obj):
    """convert any floats in a dictionary (loaded from a json) to Decimal type.
    This is required in order to load data to DynamoDB.
    """
    return json.loads(json.dumps(json_obj), parse_float=decimal.Decimal)