All Projects → JimCurryWang → Python Shopee

JimCurryWang / Python Shopee

Licence: mit
pyshopee - Shopee Partner API Client for Python

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Python Shopee

Awesome Jamstack
📔 Curated list of resources: books, videos, articles, speaker decks, tools about using the JAMstack (A modern web development architecture for creating fast, secure and dynamic websites)
Stars: ✭ 115 (-1.71%)
Mutual labels:  api
Vue Api Request
Control your API calls by using an amazing component which supports axios and vue-resource
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+9273.5%)
Mutual labels:  api
Github Repo Automation
A set of tools to automate multiple GitHub repository management.
Stars: ✭ 115 (-1.71%)
Mutual labels:  api
Active hash relation
ActiveHash Relation: Simple gem that allows you to run multiple ActiveRecord::Relation using hash. Perfect for APIs.
Stars: ✭ 115 (-1.71%)
Mutual labels:  api
Python N26
💵 Unofficial Python client for n26 (Number 26) - https://n26.com/
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Golang Gin Realworld Example App
Exemplary real world application built with Golang + Gin
Stars: ✭ 1,780 (+1421.37%)
Mutual labels:  api
Neteasecloudmusicapi
C#版 网易云音乐 API(翻译自Node.js项目Binaryify/NeteaseCloudMusicApi)
Stars: ✭ 117 (+0%)
Mutual labels:  api
Gandi Live Dns
DynDNS Updater for Gandi LiveDNS REST API
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Web3.js
Ethereum JavaScript API
Stars: ✭ 12,601 (+10670.09%)
Mutual labels:  api
Ipfs Mini
A super tiny module for querying IPFS that works in the browser and node.
Stars: ✭ 115 (-1.71%)
Mutual labels:  api
Swiftlysalesforce
The swiftest way to build iOS apps that connect to Salesforce
Stars: ✭ 115 (-1.71%)
Mutual labels:  api
Nion
🌵 Declarative API Data Management Library built on top of redux 🌵
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Wechatpay Postman Script
微信支付API v3的调试工具
Stars: ✭ 112 (-4.27%)
Mutual labels:  api
Degiroapi
An unofficial API for the trading platform Degiro, with the ability to get real time data and historical data
Stars: ✭ 114 (-2.56%)
Mutual labels:  api
Mockit
A tool to quickly mock out end points, setup delays and more...
Stars: ✭ 1,534 (+1211.11%)
Mutual labels:  api
Slouch
A JS client for CouchDB that does the heavy lifting
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Laravel Hateoas
Expose the authorization logic of your REST API using HATEOAS links
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Coinbase Pro Node
Coinbase Pro API written in TypeScript and covered by tests.
Stars: ✭ 116 (-0.85%)
Mutual labels:  api
Python Gitlab
Python wrapper for the GitLab API
Stars: ✭ 1,679 (+1335.04%)
Mutual labels:  api

pyshopee v1.3.9

PyPI GitHub Depfu

Shopee Partners API - python implementation

This is Python implementation for the Shopee Partner REST API.

If you came here looking for the Shopee seller center, to shoping, then go here.

$ pip install pyshopee
import pyshopee

client = pyshopee.Client( shopid, partnerid, API_key )

# get_order_by_status (UNPAID/READY_TO_SHIP/SHIPPED/COMPLETED/CANCELLED/ALL)
resp = client.order.get_order_by_status(order_status="READY_TO_SHIP")
print(resp)


# shop authorize and cancel_authorize url
authorize_url = client.shop.authorize(redirect_url="https://shopee.tw")
print(authorize_url)

cancel_authorize_url = client.shop.cancel_authorize(redirect_url="https://shopee.tw")
print(cancel_authorize_url)

Features

  • Simple, reliable, and elegant.
  • No need to generate authentication and timestamps by yourself, the wrapper does it for you.
  • Module format functionality the same as shopee officail document.
  • Good Response exception handling !

6 main parts of implementation

1. Shop Management Module : Shop / ShopCategory

2. Orders Management Module : Orders

3. Logistics Management Module : Logistics

4. Products Management Module : Item / Image / Discount

5. RMA Management Module : Returns

6. Collection Management Module: toppicks

Installation

  1. pip install from pypi
$ pip install pyshopee
  1. clone the repository to your local folder
$ cd pyshopee
$ python setup.py install

Quick Start

Import pyshopee & get order by status

import pyshopee

client = pyshopee.Client( shopid, partnerid, API_key )

# get_order_by_status (UNPAID/READY_TO_SHIP/SHIPPED/COMPLETED/CANCELLED/ALL)
resp = client.order.get_order_by_status(order_status="READY_TO_SHIP")
print(resp)

Get order list

# get_order_list
resp = client.order.get_order_list(create_time_from = 1512117303, create_time_to=1512635703)
print(resp)

Get order detail

'''
ordersn_list , type: String[]    
The set of order IDs. You can specify, at most, 50 OrderIDs in this call.
'''
# get_order_detail
ordersn_list = [ '1712071633982A7','1712071632981JW','171207163097YCJ']
resp = client.order.get_order_detail(ordersn_list = ordersn_list )
print(resp)

Get order escrow detail

'''
ordersn , type:String [] 
Shopee's unique identifier for an order.
'''
# get_order_escrow_detail
ordersn = '1712071633982A7'
resp = client.order.get_order_escrow_detail(ordersn = ordersn)
print(resp)

Advance Details for others functions

# usage
client.[type].[function name]

[type]
  - Shop
  - ShopCategory
  - Orders
  - Logistics
  - Item
  - Image
  - Discount
  - Returns

Advance parameters you must want to know

Timeout

You can find the source code in client.py, and pyshopee have a timeout params in there. Hence, every execute funtion can add an extra timeout setting, depending on your choice.

def execute(self, uri, method, body=None):
    ''' defalut timeout value will be 10 seconds
    '''
    parameter = self._make_default_parameter()

    if body.get("timeout"):
        timeout = body.get("timeout")
        body.pop("timeout")
    else:
        timeout = 10 

    if body is not None:
        parameter.update(body)

    req = self._build_request(uri, method, parameter)
    prepped = req.prepare()
    
    s = Session()
    resp = s.send(prepped, timeout=timeout)
    resp = self._build_response(resp)
    return resp

For example, we can set the timeout as 20 seconds in the execute requests(default value is 10s).

ordersn = '1712071633982A7'
resp = client.order.get_order_escrow_detail(ordersn = ordersn, timeout=20)
print(resp)

Add Item Example

For more details on how to add item via pyshopee, please take a look on folder "example/add.py"

Developer Note

  • From Aug, 2018 ShopeePartnerAPI will change the original apply mechanism.
    Please replace with your valid parameter(shopid,partnerid,token etc.)before sumbitting the call.

  • To get started, please check the Developer Guide under Documentation - Overview - Developer Guide
    on how to become a developer and utilize Shopee OpenAPI services.

  • Apply Authority Route:

    1. Apply Developer Authority
    2. Develper Authentication
    3. Build New App's Token
    4. Developing and Testing
    5. Seller Authority

About testtools platform

  • The default parameters are dummies except the PartnerID and Partner Key dedicated to your APP.
    Please replace with your valid parameter(shopid etc.) before sumbitting the call.
  • The testtools is based on PRODUCTION environment, please apply your PRODUCTION credential and parameters The "Request" and "Sign" tab aim to assist developer on verifying the authentication signature of API calls

Note

Source code
https://github.com/JimCurryWang/pyshopee

pypi
https://pypi.org/project/pyshopee

Shopee Parter API Documentation
https://partner.test.shopeemobile.com/docs/

Registration for Shopee Partner API usage
https://docs.google.com/forms/d/e/1FAIpQLSeCSsRHQSoQvZccOSHIl5DZAPIkSnS4ivN0Z6rp6N7JIoofvQ/viewform?c=0&w=1

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].