"""validation handler wrapper.""" from handler import handler # For example, this is how you could get this information # s3_client = boto3.client('s3') # xml_data = s3_client.get_object(Bucket=bucket, Key=key).get('Body').read() # noqa # extended_xml_data = s3_client.get_object(Bucket=bucket, Key=extended_metadata_key).get('Body').read() # noqa # The handler expects to receive Strings or Binary Strings # Binary Strings will be decoded to Strings using the UTF-8 format with open('data/awal_ddex_document_3.xml') as fd: # noqa xml_data = fd.read() with open('data/awal_ddex_document_3_ext.xml') as fd: # noqa extended_xml_data = fd.read() result = handler(xml_data, extended_xml_data) print(result) print('Rejected rules:') for rule in result: if rule.response != 'Success': print(rule)