Skip to content

Commit

Permalink
empty synopsis, compare test
Browse files Browse the repository at this point in the history
  • Loading branch information
awolosz committed Sep 2, 2024
1 parent e1fee02 commit 5d2061f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/assets/synopsis_empty.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions tests/tmp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import json

def clean_values(data):
if isinstance(data, dict):
return {k: clean_values(v) for k, v in data.items()}
elif isinstance(data, list):
return [clean_values(item) for item in data]
else:
return None

def modify_json_file(file_path):
with open(file_path, 'r', encoding="utf-8") as file:
data = json.load(file)

modified_data = clean_values(data)

with open("synopsis_empty", 'w') as file:
json.dump(modified_data, file)
return modified_data

print(modified_data)

# Replace 'your_file.json' with the path to your JSON file
tmp1 = modify_json_file('../src/assets/synopsis_szit.json')
print(tmp1)
tmp2 = modify_json_file('../src/assets/synopsis_esv.json')
print(tmp1 == tmp2)

0 comments on commit 5d2061f

Please sign in to comment.