Best practice to load a json in a python module
I have a custom Python module, call it mymodule, with a function that loads some data in a json file according to a key: import json def fetch_data(k): fname = os.path.join( os.path.abspath(os.path.dirname(__file__)), "data.json" ) with open(fname, "r") as f: data…