A python module to interact with the api of the popular agent pandabuy
Project description
Pandalib
A python module to get informations from the api of the popular agent Pandabuy
Installation
Install the package using pip
pip install pandalib
Since Pandabuy requires login for basically every api request you will need your pandabuy bearer token and your userid
Get your bearer token and user id
You can get your bearer token from the headers of any api request
You can get your user id from the profile info
Usage/Examples
Get an item info
from pandalib import pandalib, pandautilities
lib = pandalib("my bearer token", "my user id")
item = lib.get_item("https://item.taobao.com/item.htm?id=634959757581")
print(item)
Get your account balance
from pandalib import pandalib, pandautilities
lib = pandalib("my bearer token", "my user id")
balance = lib.get_balance()
print(balance)
Get your account info
from pandalib import pandalib, pandautilities
lib = pandalib("my bearer token", "my user id")
info = lib.get_user_info()
print(info)
Get your account cart
from pandalib import pandalib, pandautilities
lib = pandalib("my bearer token", "my user id")
cart = lib.get_cart()
print(cart)
Pandautilities
You can use pandautilities to estimate the shipping prices and convert cny to usd
Convert CNY to USD
from pandalib import pandalib, pandautilities
utilities = pandautilities("my bearer token", "my user id")
usd = utilities.cny_to_usd(230)
print(usd)
Estimate shipping prices
To estimate the shipping prices you can only input the weight or you can also input width, hight, length
from pandalib import pandalib, pandautilities
utilities = pandautilities("my bearer token", "my user id")
shipping_prices = utilities.estimate(weight=1200, length=30, hight=30, width = 30)
print(shipping_prices)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandalib-0.2.3.tar.gz
(3.0 kB
view hashes)