Python Rule Engine Json Formatter