{"id":13625476,"url":"https://github.com/JimCurryWang/python-shopee","last_synced_at":"2025-04-16T06:32:46.005Z","repository":{"id":37747771,"uuid":"119407345","full_name":"JimCurryWang/python-shopee","owner":"JimCurryWang","description":"pyshopee -  Shopee Partner API Client for Python","archived":false,"fork":false,"pushed_at":"2024-03-04T21:59:02.000Z","size":404,"stargazers_count":211,"open_issues_count":28,"forks_count":82,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-12T20:38:38.259Z","etag":null,"topics":["api","partner-api","python","shopee","shopee-api","shopee-partners-api"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyshopee","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JimCurryWang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-29T16:16:55.000Z","updated_at":"2024-09-24T17:47:50.000Z","dependencies_parsed_at":"2024-08-01T22:02:01.973Z","dependency_job_id":"a8f2bbf1-2629-41b6-bd4e-770ddcbe16ff","html_url":"https://github.com/JimCurryWang/python-shopee","commit_stats":null,"previous_names":["jimcurrywang/pyshopee"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimCurryWang%2Fpython-shopee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimCurryWang%2Fpython-shopee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimCurryWang%2Fpython-shopee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimCurryWang%2Fpython-shopee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JimCurryWang","download_url":"https://codeload.github.com/JimCurryWang/python-shopee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223700494,"owners_count":17188332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","partner-api","python","shopee","shopee-api","shopee-partners-api"],"created_at":"2024-08-01T21:01:56.402Z","updated_at":"2024-11-08T14:31:30.679Z","avatar_url":"https://github.com/JimCurryWang.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"pyshopee v1.4.0\n================================\n\n[![PyPI](https://img.shields.io/badge/pypi-v1.3.7-blue.svg)](https://pypi.org/project/pyshopee/)\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/JimCurryWang/python-shopee)\n[![Depfu](https://img.shields.io/depfu/depfu/example-ruby.svg)](https://github.com/JimCurryWang/python-shopee)\n  \n\nShopee Partners API - python implementation \n---------------------------------------------\nThis is Python implementation for the [Shopee Partner REST API](https://partner.test.shopeemobile.com/docs/).  \n\nIf you came here looking for the [Shopee seller center](https://seller.shopee.tw/), to shoping, then [go here](https://shopee.tw/).\n\n```shell\n$ pip install pyshopee\n```\n\n### Example for using pyshopee2 (Latest)\n\n- change `pyshopee.Client` to `pyshopee.Client20`\n\n```python\nimport pyshopee\n\nclient = pyshopee.Client20( shopid, partnerid, API_key )\n\n# get_order_by_status (UNPAID/READY_TO_SHIP/SHIPPED/COMPLETED/CANCELLED/ALL)\nresp = client.order.get_order_by_status(order_status=\"READY_TO_SHIP\")\nprint(resp)\n\n\n# shop authorize and cancel_authorize url\nauthorize_url = client.shop.authorize(redirect_url=\"https://shopee.tw\")\nprint(authorize_url)\n\ncancel_authorize_url = client.shop.cancel_authorize(redirect_url=\"https://shopee.tw\")\nprint(cancel_authorize_url)\n```\n\n### Example for using pyshopee (old)\n\n```python\nimport pyshopee\n\nclient = pyshopee.Client( shopid, partnerid, API_key )\n\n# get_order_by_status (UNPAID/READY_TO_SHIP/SHIPPED/COMPLETED/CANCELLED/ALL)\nresp = client.order.get_order_by_status(order_status=\"READY_TO_SHIP\")\nprint(resp)\n\n\n# shop authorize and cancel_authorize url\nauthorize_url = client.shop.authorize(redirect_url=\"https://shopee.tw\")\nprint(authorize_url)\n\ncancel_authorize_url = client.shop.cancel_authorize(redirect_url=\"https://shopee.tw\")\nprint(cancel_authorize_url)\n```\n\nFeatures\n--------\n  \n- Simple, reliable, and elegant.\n- No need to generate authentication and timestamps by yourself, the wrapper does it for you.\n- Module format functionality the same as shopee officail document.\n- Good Response exception handling !\n\n_6_ main parts of implementation\n---------------------------\n#### 1. Shop Management Module : [Shop](https://open.shopee.com/documents?module=6\u0026type=1\u0026id=410) / [ShopCategory](https://open.shopee.com/documents?module=7\u0026type=1\u0026id=404) \n\n#### 2. Orders Management Module : [Orders](https://open.shopee.com/documents?module=4\u0026type=1\u0026id=394)\n\n#### 3. Logistics Management Module : [Logistics](https://open.shopee.com/documents?module=3\u0026type=1\u0026id=384)\n\n#### 4. Products Management Module : [Item](https://open.shopee.com/documents?module=2\u0026type=1\u0026id=365) / [Image](https://open.shopee.com/documents?module=65\u0026type=1\u0026id=412) / [Discount](https://open.shopee.com/documents?module=1\u0026type=1\u0026id=357)\n\n#### 5. RMA Management Module : [Returns](https://open.shopee.com/documents?module=5\u0026type=1\u0026id=401)\n\n#### 6. Collection Management Module: [toppicks](https://open.shopee.com/documents?module=67\u0026type=1\u0026id=435)\n\n\n\n\n\nInstallation\n-------\n1. pip install from pypi\n```shell\n$ pip install pyshopee\n```\n2. clone the repository to your local folder\n```shell\n$ cd pyshopee\n```\n```shell\n$ python setup.py install\n```\n\nQuick Start\n-----------\n\n#### Import pyshopee \u0026 get order by status\n```python\nimport pyshopee\n\nclient = pyshopee.Client( shopid, partnerid, API_key )\n\n# get_order_by_status (UNPAID/READY_TO_SHIP/SHIPPED/COMPLETED/CANCELLED/ALL)\nresp = client.order.get_order_by_status(order_status=\"READY_TO_SHIP\")\nprint(resp)\n```\n#### Get order list \n\n```python\n# get_order_list\nresp = client.order.get_order_list(create_time_from = 1512117303, create_time_to=1512635703)\nprint(resp)\n```\n#### Get order detail\n\n```python\n'''\nordersn_list , type: String[]    \nThe set of order IDs. You can specify, at most, 50 OrderIDs in this call.\n'''\n# get_order_detail\nordersn_list = [ '1712071633982A7','1712071632981JW','171207163097YCJ']\nresp = client.order.get_order_detail(ordersn_list = ordersn_list )\nprint(resp)\n```\n\n#### Get order escrow detail\n```python\n'''\nordersn , type:String [] \nShopee's unique identifier for an order.\n'''\n# get_order_escrow_detail\nordersn = '1712071633982A7'\nresp = client.order.get_order_escrow_detail(ordersn = ordersn)\nprint(resp)\n```\n\n\nAdvance Details for others functions\n--------\n\n```python\n# usage\nclient.[type].[function name]\n\n[type]\n  - Shop\n  - ShopCategory\n  - Orders\n  - Logistics\n  - Item\n  - Image\n  - Discount\n  - Returns\n```\n\n\nAdvance parameters you must want to know\n--------\n\n### Timeout\n\nYou can find the source code in client.py, and pyshopee have a timeout params in there.\nHence, every execute funtion can add an extra timeout setting, depending on your choice.\n\n```python\n\ndef execute(self, uri, method, body=None):\n    ''' defalut timeout value will be 10 seconds\n    '''\n    parameter = self._make_default_parameter()\n\n    if body.get(\"timeout\"):\n        timeout = body.get(\"timeout\")\n        body.pop(\"timeout\")\n    else:\n        timeout = 10 \n\n    if body is not None:\n        parameter.update(body)\n\n    req = self._build_request(uri, method, parameter)\n    prepped = req.prepare()\n    \n    s = Session()\n    resp = s.send(prepped, timeout=timeout)\n    resp = self._build_response(resp)\n    return resp\n```\n\nFor example, we can set the timeout as 20 seconds in the execute requests(default value is 10s).\n\n```python\nordersn = '1712071633982A7'\nresp = client.order.get_order_escrow_detail(ordersn = ordersn, timeout=20)\nprint(resp)\n\n```\n\n### Add Item Example\n\nFor more details on how to add item via pyshopee, please take a look on folder \"example/add.py\"\n\n\nDeveloper Note\n--------------\n- From Aug, 2018  ShopeePartnerAPI  will change the original apply mechanism.        \nPlease replace with your valid parameter(shopid,partnerid,token etc.)before sumbitting the call.\n\n- To get started, please check the [Developer Guide under Documentation](https://open.shopee.com/) - Overview - Developer Guide    \non how to become a developer and utilize Shopee OpenAPI services.\n\n- Apply Authority Route:    \n    1. Apply Developer Authority\n    2. Develper Authentication\n    3. Build New App's Token     \n    4. Developing and Testing \n    5. Seller Authority\n\n\n\nAbout testtools platform\n------------------------\n- The default parameters are dummies except the *PartnerID* and *Partner Key* dedicated to your APP.    \n  Please replace with your valid parameter(shopid etc.) before sumbitting the call.    \n- The testtools is based on PRODUCTION environment, please apply your PRODUCTION credential and parameters\n  The \"Request\" and \"Sign\" tab aim to assist developer on verifying the authentication signature of API calls\n  \n  \n  \nNote\n----\n\n_Source code_  \n    https://github.com/JimCurryWang/pyshopee\n\n_pypi_    \n    https://pypi.org/project/pyshopee\n\n_Shopee Parter API Documentation_  \n    https://partner.test.shopeemobile.com/docs/\n    \n_Registration for Shopee Partner API usage_  \n    https://docs.google.com/forms/d/e/1FAIpQLSeCSsRHQSoQvZccOSHIl5DZAPIkSnS4ivN0Z6rp6N7JIoofvQ/viewform?c=0\u0026w=1\n    \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJimCurryWang%2Fpython-shopee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJimCurryWang%2Fpython-shopee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJimCurryWang%2Fpython-shopee/lists"}