diff --git a/Plotter/plotter.py b/Utilities/Files/Json/__init__.py similarity index 100% rename from Plotter/plotter.py rename to Utilities/Files/Json/__init__.py diff --git a/Utilities/Files/Json/json_utils.py b/Utilities/Files/Json/json_utils.py new file mode 100644 index 0000000..0a54c33 --- /dev/null +++ b/Utilities/Files/Json/json_utils.py @@ -0,0 +1,15 @@ +# Python Imports +import json +import jsonschema + + +def read_json(file_path): + with open(file_path, "r") as file: + json_content = json.load(file) + + return json_content + + +def validate_json(json_content, json_schema): + jsonschema.validate(instance=json_content, schema=json_schema) + diff --git a/Utilities/file_parser.py b/Utilities/file_parser.py deleted file mode 100644 index 7725f2e..0000000 --- a/Utilities/file_parser.py +++ /dev/null @@ -1,23 +0,0 @@ -import json - - -class ConfigurationFileParser: - - def __init__(self, file_path): - self._file_path = file_path - - def read_content(self): - # Retrieve raw info - data = self._parse_file() - - # Check valid flags depending on simulation () - print("asd") - # Parse values - - return "data" - - def _parse_file(self): - with open(self._file_path, "r") as file: - data = json.load(file) - - return data