#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import sys for line in sys.stdin: try: data = json.loads(line) # trace #print("******** FORMAT OK : id:{}".format(data["id"])) except json.decoder.JSONDecodeError: mess='[{"code" : "1","message":"Input format problem line :{compteur} : String could not be converted to JSON".format(compteur)"}]' exit({mess}) result=(data['value']).lower() # test if result is json data["value"] = result sys.stdout.write(json.dumps(data)) sys.stdout.write('\n')