淘宝与openerp整合
-
贴个API的使用代码
<br />from taobaoapi import *<br />from trans import *<br />from params import *<br />from parsers import *<br />import utf8<br /><br />#trans = Transport(JsonParser())<br />trans = Transport(XmlParser())<br /><br />sysParams = SysParams(app_key='test')<br />sysParams.AppSecret='test'<br /><br /><br />TOP = TaoBao(trans,sysParams)<br />img=open('test.jpg')<br /><br />p={'num':'123',<br /> 'image':img,<br /> 'price':'321.00',<br /> 'type':'fixed',<br /> 'stuff_status':u'new',<br /> 'title':'title',<br /> 'desc':'dsffesc',<br /> 'location.state':u'浙江',<br /> 'location.city':u'杭州',<br /> 'cid':'50019153',<br /> }<br /><br />#rsp = TOP.taobao.itemcats.get(fields='cid,parent_cid,name,is_parent',datetime='2000-01-01 00:00:00')<br />#for r in rsp[u'item_cats'][u'item_cat']:<br /># print(r[u'is_parent'])<br /># print('\n%s\n%s'%(r[u'cid'],r[u'name']))<br />#rsp = TOP.taobao.product.img.upload(**p)<br />rsp = TOP.taobao.item.add(**p)<br />print(rsp)<br />