Skip to content

Commit

Permalink
add summary in db-compare
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 15, 2024
1 parent 3caa652 commit 0efa05b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/builder2ibek/dbcompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ def compare_dbs(original: Path, new: Path):
for record in regex_record.finditer(new_text):
new_set.add(f"{record.group(1)} {record.group(2)}")

print("*******************************************************************")
old_only = sorted(old_set - new_set)
new_only = sorted(new_set - old_set)
print("\n*****************************************************************")
print("Records in original but not in new:")
print("\n".join(sorted(old_set - new_set)))
print("*******************************************************************")
print("\n".join(old_only))
print("\n*****************************************************************")
print("Records in new but not in original:")
print("\n".join(sorted(new_set - old_set)))
print("\n".join(new_only))
print("\n*****************************************************************")
print(" records in original: ", len(old_set))
print(" records in new: ", len(new_set))
print(" records missing in new: ", len(old_only))
print(" records extra in new: ", len(new_only))

0 comments on commit 0efa05b

Please sign in to comment.