集合了淘宝开放平台的商铺OPEN API,并适配了Python3
Project description
b’# xe6xb7x98xe5xaex9dPython SDKxe4xbcx98xe5x8cx96xe6x94xafxe6x8cx81Python3nnxe6xb7x98xe5xaex9dxe5xbcx80xe6x94xbexe5xb9xb3xe5x8fxb0xe7x9ax84SDKxefxbcx8cPythonxe7x9ax84 SDK xe6x98xafxe5x9cxa82012xe5xb9xb4xefxbcx8cxe4xbbx85xe6x94xafxe6x8cx81Python2.7 xe5x8fx8axe4xbbxa5xe4xb8x8axefxbcx8cxe4xbdx86xe4xb8x8dxe6x94xafxe6x8cx81Python3xefxbcx9bxe4xbax8cxe7x8exb0xe5x9cxa8xe6x98xaf2102xe5xb9xb4xe4xbax86xefxbcx8cxe5x83x8fxe6x88x91xe8xbfx99xe6xa0xb7xe7x9ax84xe6x96xb0xe6x89x8bxe9x83xbdxe6x98xafxe7x9bxb4xe6x8exa5xe4xbbx8ePython3xe5xbcx80xe5xa7x8bxe7x9ax84nn## xe6x8cx81xe7xbbxadxe8xa1xa5xe5x85x85SDKxe8x83xbdxe5x8ax9bnnxe6xb7x98xe5xaex9dxe5xbcx80xe6x94xbexe5xb9xb3xe5x8fxb0xe5x90x8exe5x8fxb0xe4xb8x8bxe8xbdxbdxe8x8exb7xe5x8fx96xe5x88xb0xe7x9ax84SDKxe6x96x87xe4xbbxb6xefxbcx8cxe4xbcx9axe6xa0xb9xe6x8dxaexe5xbax94xe7x94xa8xe7x9ax84xe6x9dx83xe9x99x90xe7x94x9fxe4xbaxa7xe5xafxb9xe5xbax94xe7x9ax84SDKxe5x8cx85xefxbcx8cxe6x89x80xe4xbbxa5xe4xbdxa0xe5x8fxafxe8x83xbdxe8x8exb7xe5x8fx96xe5x88xb0xe7x9ax84xe6x98xafxe5x87xa0xe5x8dx81xe4xb8xaaxe6x88x96xe8x80x85xe4xb8x8axe7x99xbexe4xb8xaannNOTE: xe5xa6x82xe6x9ex9cxe4xbdxa0xe6x9cx89xe5x85xb6xe4xbbx96xe7x9ax84SDKxe6xb2xa1xe6x9cx89xe5x9cxa8xe6x96x87xe6xa1xa3xe4xb8xadxe6x89xbexe5x88xb0xefxbcx8cxe5x8fxafxe4xbbxa5xe5x8fx8dxe9xa6x88xe7xbbx99xe6x88x91xe6x88x96xe8x80x85xe6x8fx90 `Pull requests`xefxbcx8cxe5xa4xa7xe5xaexb6xe4xb8x80xe8xb5xb7xe6x89xa9xe5x85x85SDKnn## xe9x80x82xe9x85x8dxe9x83xa8xe5x88x86xe4xbbx8bxe7xbbx8dnn#### 1. Python3 intxe6x9bxbfxe4xbbxa3xe4xbax86longnnn```python3nFROM: str(long(time.time() * 1000))nnTO: P_TIMESTAMP: str(int(time.time() * 1000))n```nn#### 2. xe7x94xa8itemsxe6x9bxbfxe4xbbxa3iteritems:nn```python3nFROM: for key, value in application_parameter.iteritems():nTO: for key, value in application_parameter.items():n```nn#### 3. xe6x9fxa5xe9x98x85xe8xb5x84xe6x96x99xefxbcx8cxe5x8fx91xe7x8exb0xe6x9cx89xe4xbaxbaxe8xafxb4xe5x88xb0dict methods dict.keys(), dict.items() and dict.values() return xe2x80x9cviewsxe2x80x9d instead of lists.xe8xbfx99xe6xa0xb7xe5xb0xb1xe6x98xbexe8x80x8cxe6x98x93xe8xa7x81xe7x9fxa5xe9x81x93xe6x80x8exe4xb9x88xe6x94xb9xe4xbax86xefxbcx9ann```python3nFROM: keys = keys.sort()nTO: keys = sorted(keys)n```nn#### 4. xe8x8bxb1xe6x96x87xe6x84x8fxe6x80x9dxe5xbex88xe6x98x8exe7xa1xaexefxbcx8cunicodexe5xafxb9xe8xb1xa1xe5x9cxa8xe5x93x88xe5xb8x8cxe4xb9x8bxe5x89x8dxe5xbfx85xe9xa1xbbxe8xbfx9bxe8xa1x8cxe7xbcx96xe7xa0x81xe8xbdxacxe6x8dxa2xefxbcx8cxe6x83xb3xe8xb5xb7xe4xb9x8bxe5x89x8dxe5x8fx88xe7x9cx8bxe5x88xb0xe8xbfx87xe4xb8xadxe6x96x87xe5xadx97xe7xacxa6xe5x9cxa8pythonxe4xb8xadxe6x98xafxe4xbbxa5unicodexe5xadx98xe5x9cxa8xe7x9ax84xefxbcx8cxe6x89x80xe4xbbxa5xefxbcx9ann```python3nFROM: sign = hashlib.md5(parameters)).hexdigest().upper()nTO: sign = hashlib.md5(parameters.encode(“utf-8”)).hexdigest().upper()n```nn#### 5. xe8xbfx99xe6x98xafxe8x8axb1xe8xb4xb9xe6x97xb6xe9x97xb4xe6x9cx80xe9x95xbfxe7x9ax84xe4xb8x80xe4xb8xaaxe9x94x99xe8xafxafxe3x80x82xe9xa6x96xe5x85x88xefxbcx8cxe7x9bxb4xe6x8exa5xe7x9cx8bxe6x9cx80xe5x90x8exefxbcx8cxe9x94x99xe8xafxafxe5x9cxa8soket.pyxe9x87x8cxefxbcx8cxe5xbfx83xe5x87x89xe4xbax86xe5x8dx8axe6x88xaaxefxbcx8cxe9x9axbexe9x81x93xe8xbfx99xe9x87x8cxe7x9ax84xe8xb0x83xe7x94xa8xe9x83xbdxe4xb8x8dxe4xb8x80xe6xa0xb7xe4xbax86,xe5x86x8dxe7xbdx91xe4xb8x8axe7x9cx8bxe5x8fx88xe6x98xafpython 3.Xxe7x9ax84httpxe6xa8xa1xe5x9dx97xefxbcx8cxe5x8exbbxe7x99xbexe5xbaxa6xe4xbax86xe5x8dx8axe5xa4xa9xe4xb9x9fxe6xb2xa1xe6x9cx89xe5x8fx91xe7x8exb0xe7xb1xbbxe4xbcxbcxe7x9ax84xe9x94x99xe8xafxafxefxbcx8cxe5x8fxaaxe8x83xbdxe8x87xaaxe5xb7xb1xe7xa1xacxe7x9dx80xe5xa4xb4xe7x9axaexe5x8exbbxe7x9cx8bxe6xa8xa1xe5x9dx97xefxbcx8cxe5x8ax9fxe5xa4xabxe4xb8x8dxe8xb4x9fxe6x9cx89xe5xbfx83xe4xbaxbaxefxbcx8cxe5x85xb6xe5xaex9exe4xb9x9fxe5xbex88xe7xaex80xe5x8dx95xefxbcx8cxe5x9cxa8xe7xb1xbbHTTPConnectionxe7x9ax84xe5x88x9dxe5xa7x8bxe5x8cx96xe5x87xbdxe6x95xb0xe6x98xafxe8xbfx99xe6xa0xb7xe5xaex9axe4xb9x89xe7x9ax84:nn```python3nFROM: connection = httplib.HTTPConnection(self.__domain, self.__port, False, timeout)nTO: connection = httplib.HTTPConnection(self.__domain, self.__port, timeout)n```nn> xe6xafx94xe8xbex83xe4xb8x8bxe5x8fx82xe6x95xb0xe5x8fx91xe7x8exb0xefxbcx8cpython 2xe6xafx943xe5xa4x9axe4xbax86xe4xb8x80xe4xb8xaaxe5x8fx82xe6x95xb0xefxbcx8cxe5x8exbbxe6x8ex89xe5x8dxb3xe5x8fxafxefxbcx8cxe8xbfx99xe4xb8xaaxe9x94x99xe8xafxafxe4xb8xbbxe8xa6x81xe6x98xafxe6x98xafxe6x8axa5xe9x94x99xe7x9ax84xe5x9cxb0xe6x96xb9xe5x92x8cxe4xbfxaexe6x94xb9xe7x9ax84xe5x9cxb0xe6x96xb9xe4xb8x8dxe5x9cxa8xe4xb8x80xe8xb5xb7xefxbcx8cxe6x89x80xe4xbbxa5xe5xbex88xe9x9axbexe6x8fx92xe5x87xbaxe5x8ex9fxe5x9bxa0xe3x80x82nn#### 6. xe5xaex98xe6x96xb9xe6x96x87xe6xa1xa3xe6x98xafxe8xbfx99xe6xa0xb7xe8xa7xa3xe9x87x8axe7x9ax84xefxbcx9aurllib has been split up in Python 3. The urllib.urlencode() function is now urllib.parse.urlencode(), and the urllib.urlopen() function is now urllib.request.urlopen()nn```python3nFROM: url = N_REST + “?” + urllib.parse.urlencode(sys_parameters)nTO: url = N_REST + “?” + urllib.urlencode(sys_parameters)n```nn#### 7. xe8xbfx99xe4xb8xaaxe9x94x99xe8xafxafxe6x98xafxe5x9cxa8APIxe8xb0x83xe7x94xa8xe5x87xbaxe5xbcx82xe5xb8xb8xe7x9ax84xe6x97xb6xe5x80x99xe6x9axb4xe9x9cxb2xe5x87xbaxe6x9dxa5xe7x9ax84xe3x80x82xe5x8ex9fxe5x9bxa0xe5x89x8dxe9x9dxa2xe5xb7xb2xe7xbbx8fxe6x8fx90xe5x88xb0xe4xbax86xefxbcx8cxe7xa8x8dxe5xbexaexe6x9fxa5xe4xbax86xe4xb8x8bxe6x9bxbfxe4xbbxa3xe7x9ax84xe6x96xb9xe6xb3x95xefxbcx9ann```python3nif “error_response” in jsonobj:nif P_CODE in jsonobj[“error_response”]:n```nnn#### 8. xe5x9cxa8if xe9x9cx80xe8xa6x81xe4xbdxbfxe7x94xa8xe5x8fx8dxe5x90x91xe6x97xb6xefxbcx8cxe5xbax94xe8xafxa5xe6x98xaf != xefxbcx8cxe8x80x8cxe4xb8x8dxe6x98xafxe4xbdxbfxe7x94xa8 is not xefxbcx9bxe8xbfx99xe4xb8xaaxe4xb9x9fxe6x98xaf PyCharm xe7xbbx99xe7x9ax84xe5xbbxbaxe8xaexaexefxbcx8cxe6x89x80xe4xbbxa5xe5x9cxa8xe4xbdxbfxe7x94xa8xe6x97xb6xefxbcx8cxe6x89x80xe4xbbxa5xe7xaex80xe5x8dx95xe8xb0x83xe6x95xb4xe4xb8x8bxe5xb0xb1xe5xa5xbdxe4xbax86nn```python3nif response.status != 200:n```nn—nnxe4xbbxa5xe4xb8x8axe8xb0x83xe6x95xb4xe4xb9x8bxe5x90x8exefxbcx8cxe5x9fxbaxe6x9cxacxe5xb0xb1xe5x8fxafxe4xbbxa5xe6xadxa3xe5xb8xb8xe8xb7x91xe8xb5xb7xe6x9dxa5xe4xbax86xefxbcx8cxe5x9fxbaxe6x9cxacxe6x98xafxe5x8fxafxe4xbbxa5xe6x94xafxe6x8cx81Python3xe7x9ax84xe4xbdxbfxe7x94xa8xefxbcx8cxe6x88x91xe8xafx95xe8xbfx87xe4xbax86Python3.6-3.9xefxbcx8cxe9x83xbdxe6x98xafOKxe7x9ax84xe3x80x82n’
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.