# -*- coding: utf-8 -*-## This file is subject to the terms and conditions defined in# file 'LICENSE.txt', which is part of this source code package.#"""Json file reader"""importjson
[docs]defReadJson(fileName=None,text=None):"""Function API for reading a json file Parameters ---------- fileName : str, optional name of the file to be read, by default None text : str, optional data to be read as a string instead of a file, by default None Returns ------- _type_ _description_ """iffileNameisnotNone:withopen(fileName)asdata_file:returnjson.load(data_file)iftextisnotNone:returnjson.loads(text)returnNone