if not _spec_type:
    return obj
if _spec_type in CONVERTERS:
    return CONVERTERS[_spec_type](obj['val'])
else:
    raise Exception('Unknown {}'.format(_spec_type))

def main():
    data = {'hello': 'world', 'thing': datetime.datetime.now(), 'other':
        decimal.Decimal(0)}
thing = json.dumps(data, cls=MyJSONEncoder)
print(json.loads(thing, object_hook=object_hook))
if __name__ == '__main__':
    main()
Разбор даты и времени в загрузках python json