Skip to content

Commit

Permalink
Add write to json function in io
Browse files Browse the repository at this point in the history
  • Loading branch information
Erfan-Ghaziasgar committed Aug 9, 2023
1 parent 0938b96 commit 05bc417
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
def read_json(file_path):
with open(file_path, 'r') as f:
return json.load(f)

def write_json(file_path, data):
with open(file_path, 'w') as f:
json.dump(data, f, indent=4, sort_keys=True)

0 comments on commit 05bc417

Please sign in to comment.