Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Good news. Especially for beginners. #53

Open
himacri opened this issue May 26, 2023 · 0 comments
Open

Good news. Especially for beginners. #53

himacri opened this issue May 26, 2023 · 0 comments

Comments

@himacri
Copy link

himacri commented May 26, 2023

Hello. Good news

I use pyshopee2 on a daily basis to manage my products.
My day job has nothing to do with programming and I am at a beginner level.
I am doing my research one by one, and I am happy to report that ### I have reached a turning point in my career.eer.

I posed this question to chatGPT

I'm currently using an external API called pyshopee2 to work with the shopeeAPI.
How can I use this to change product prices?
Here is the page about pyshopee2 product.
https://github.com/JimCurryWang/python-shopee/blob/master/pyshopee2/product.py

AI then replied with this

We will explain how to use the pyshopee2 library you specified to work with the Shopee API to perform product price changes.
Please follow these steps

Install the pyshopee2 library using the pip install pyshopee2 command.

Create a Shopee developer account and obtain an API key; create an account on the Shopee Developers portal (https://developers.shopee.com/) and obtain an API key when you create your application.

Import the python script to use the python script to import the pyshopee2 library.

from pyshopee2 import ShopeeShop, PartnerConfig

Create a ShopeeShop object and connect it to the Shopee API. Use the following code to specify the API key and store ID.

config = PartnerConfig(partner_id=YOUR_PARTNER_ID, partner_key=YOUR_PARTNER_KEY)
shop = ShopeeShop(config, shopid=YOUR_SHOP_ID)

Change the price of an item, the product.py file has a method update_item_price that can be used to update the price.

item_id = YOUR_ITEM_ID
new_price = 1000 # new price

# Update the price of the item
shop.product.update_item_price(item_id, new_price)

In the above code, item_id is the ID of the item to be changed and new_price is the new price. by calling the update_item_price method, the price of the item can be changed.

In this way, the pyshopee2 library can be used to change the price of an item.

However, be sure to properly protect your API key and other authentication information, and be careful about security when using it.

Note that the version and specifications of the pyshopee2 library may change, so please refer to the official repositories and documentation for the latest information.

This is as wonderful as a posting from God to me.

I haven't checked out the pros and cons of the "I'm not sure if this is a good idea or not, but from a quick glance, it looks like it will work properly.

For those of you who are stumped as I am, chatGPT will be a powerful ally for you.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant