from wrpylib import mwdb, wrmwdb
-def main():
- filename = '/home/philipp/daten/Winterrodeln/Intermaps/intermaps_winterrodeln_2019-12-06_090501.json'
+def investigate(filename: str, write_back_formatted: bool):
+ """Displays statistics about a Intermaps json file."""
with open(filename) as fp:
content = json.load(fp)
regions = content['items']
duplicates = {sledrun_id for sledrun_id in sledrun_ids_set if sum(sr_id == sledrun_id for sr_id in sledrun_ids_list) >= 2}
print(duplicates)
print(max(map(len, sledrun_ids_set))) # 36
- with open(filename, 'w') as fp:
- json.dump(content, fp, indent='\t')
+ if write_back_formatted:
+ with open(filename, 'w') as fp:
+ json.dump(content, fp, indent='\t')
class UpdateError(RuntimeError):