def _parse(self, content): """Parse the response of the webservice, assumed to be a XML in utf-8. :param content: response from the webservice :return: a dict of the content """ parsed_content = super(PrestaShopWebServiceDict, self)._parse(content) return xml2dict.ET2dict(parsed_content)
}, }, 'value': 'test description english' }, { 'attrs': { 'id': '2', 'href': { 'value': 'http://localhost:8080/api/languages/1', 'xmlns': 'http://www.w3.org/1999/xlink' }, }, 'value': 'test description french' }], }, } } } print dict2xml(x) import xml2dict from prestapyt import PrestaShopWebService prestashop = PrestaShopWebService('http://localhost:8080/api', 'BVWPFFYBT97WKM959D7AVVD0M4815Y1L') products_xml = prestashop.get('products', 1) products_dict = xml2dict.ET2dict(products_xml) pprint(dict2xml(products_dict))