orjson icon indicating copy to clipboard operation
orjson copied to clipboard

orjson.dump() and orjson.load() should be support

Open fighterhit opened this issue 1 year ago • 0 comments

Both the official json library and UltraJSON support these two functions, and I think orjson should also support them. I found a related issue #329, but it seems that these two methods are still not supported at present. Can they be supported directly or is there any work around way to support them?

e.g.

import json

# load from json file
with open('config/config.json', 'r') as f:
  data_dict = json.load(f)


# dump to file
data = {"1": 11, "2": 22, "3": 33, "4": 44}
with open('./test.json', 'w') as f:
    json.dump(data, f)

fighterhit avatar Aug 26 '24 05:08 fighterhit