clearml-server/apiserver/utilities/json.py

11 lines
350 B
Python
Raw Permalink Normal View History

2019-06-10 21:24:35 +00:00
import rapidjson
# Dump datetime in ISO format
# treat "native" datetime objects as UTC
DATETIME_MODE = rapidjson.DM_ISO8601 | rapidjson.DM_NAIVE_IS_UTC
dumps = rapidjson.Encoder(datetime_mode=DATETIME_MODE)
dumps_notascii = rapidjson.Encoder(datetime_mode=DATETIME_MODE, ensure_ascii=False)
2019-06-10 21:24:35 +00:00
loads = rapidjson.Decoder(datetime_mode=DATETIME_MODE)