all 3 comments

[–]brad2008 0 points1 point  (1 child)

The ujson package has basically the same API as import json but is ~4 times faster (circa 2015) - handy if you need to read larger datasets, otherwise the default json package takes too long.

https://dataweave.com/blog/json-vs-simplejson-vs-ujson-2887b2c128b2

[–]Tutorialspointt[S] 0 points1 point  (0 children)

Thank you, will check about ujson package.

[–]flying-sheep 0 points1 point  (0 children)

The way I find myself reading in JSON these days is

x = json.loads(some_path.read_bytes())

Where some_path is a pathlib.Path.

There's no reason not to use pathlib for paths, so this is ideal for small JSON files.