def check_decimal_element(decimal_string):
    try:
        decimal.Decimal(decimal_string)
    except decimal.InvalidOperation:
        raise ValueError

# register the decimal type with objectify
Catch decimal's exception and raise the one objectify expects
dataset/ETHPy150Open freshbooks/refreshbooks/refreshbooks/api.py/check_decimal_element