|
|
@ -1,3 +1,4 @@ |
|
|
|
from typing import Any |
|
|
|
import json |
|
|
|
import os.path |
|
|
|
|
|
|
@ -8,5 +9,12 @@ def load_json(filename: str): |
|
|
|
content = json.load(f) |
|
|
|
return content |
|
|
|
|
|
|
|
def dump_json(filename: str, data: Any): |
|
|
|
with open(filename + ".json", "w") as f: |
|
|
|
json.dump(data, f) |
|
|
|
|
|
|
|
def load_data(filename: str): |
|
|
|
return load_json(os.path.join(DATA_FOLDER, filename)) |
|
|
|
|
|
|
|
def dump_data(filename: str, data: Any): |
|
|
|
return dump_json(os.path.join(DATA_FOLDER, filename), data) |
|
|
|