A Python client for the Coupang API
Project description
PyCoupang
PyCoupang is a Python client library for the Coupang WING API. It provides a simple interface to interact with Coupang's API endpoints.
Installation
Install PyCoupang using pip:
pip install python-coupang
Usage
To use the PyCoupang library, you need to set up your environment with the necessary credentials. You can get these credentials by registering an application on the Coupang Developer Portal.
Once you have your credentials, you can set them as environment variables:
export COUPANG_ACCESS_KEY=<your_access_key>
export COUPANG_SECRET_KEY=<your_secret_key>
export COUPANG_VENDOR_ID=<your_vendor_id>
Alternatively, you can create a .env
file in your project root with these variables:
COUPANG_ACCESS_KEY=<your_access_key>
COUPANG_SECRET_KEY=<your_secret_key>
COUPANG_VENDOR_ID=<your_vendor_id>
Then, you can use the library in your Python code:
import os
from dotenv import load_dotenv
from pycoupang.client import CoupangClient
# Optionally load environment variables if using .env file
load_dotenv()
client = CoupangClient(
access_key=os.getenv('COUPANG_ACCESS_KEY'),
secret_key=os.getenv('COUPANG_SECRET_KEY'),
vendor_id=os.getenv('COUPANG_VENDOR_ID')
)
# list products
response = client.products.list_products(vendor_id=os.getenv('COUPANG_VENDOR_ID'))
# get a specific product
response = client.products.get("product_id")
# create a new product
new_product_data = {
# Your product data here
}
response = client.products.create(new_product_data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_coupang-0.1.2.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for python_coupang-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5be2eb5f08fefbedca9f04c8566a36656b4e03e926266ddb48789b268b122061 |
|
MD5 | fbf858bd3344015b53772f227cc57f98 |
|
BLAKE2b-256 | 422d33f7ee1c92e554dba5d98074cc6f83932854db1cd15432d945159556ae69 |