OpenSlides/dev-commands/strip-meta-fields.py

12 lines
326 B
Python
Raw Normal View History

2020-10-16 13:11:00 +02:00
import sys
import json
data = sys.stdin.read()
json_data = json.loads(data)
for collection, models in json_data.items():
for model in models:
for field in list(model.keys()):
if field.startswith("meta_"):
del model[field]
sys.stdout.write(json.dumps(json_data, separators=(',', ':')))