An SDK for the Sugarcoat API
Project description
# Sugarcoat Python SDK
The Sugarcoat SDK for Python applications.
## Installation
Install from source:
```
$ git clone git@gitlab.com:sugarcoat/sugarcoat-python-sdk.git
$ cd sugarcoat-python-sdk
$ pip install -r requirements.txt
```
## Usage
Copy the config file and add relevant API key:
```
cp config.py.dist config.py
```
Create the Sugarcoat object
```
from sugarcoat.sugarcoat import Sugarcoat
sc = Sugarcoat()
```
You can now create a wrapper, for example:
```
product = sc.Product
```
And perform actions on that wrapper:
```
product.list()
#{
# "count": 2,
# "current_page": 1,
# "last_page": 1,
# "products": [
# {
# "id": 1,
# "store_id": 1,
# "parent_product_id": null,
# "search_engine_data_id": null,
# "product_type_id": null,
# "thumbnail_id": null,
# "slug": "jb-product",
```
## Quick Reference
```
sc = Sugarcoat() # Create new Sugarcoat instance
sc.Product # Create Product wrapper
Product.list() # List all products
Product.read(1) # Read product with id 1
Product.create(payload) # Create product with passed payload
Product.update(1, payload) # Update product id 1 with passed payload
Product.delete(1) # Delete product id 1
```
The Sugarcoat SDK for Python applications.
## Installation
Install from source:
```
$ git clone git@gitlab.com:sugarcoat/sugarcoat-python-sdk.git
$ cd sugarcoat-python-sdk
$ pip install -r requirements.txt
```
## Usage
Copy the config file and add relevant API key:
```
cp config.py.dist config.py
```
Create the Sugarcoat object
```
from sugarcoat.sugarcoat import Sugarcoat
sc = Sugarcoat()
```
You can now create a wrapper, for example:
```
product = sc.Product
```
And perform actions on that wrapper:
```
product.list()
#{
# "count": 2,
# "current_page": 1,
# "last_page": 1,
# "products": [
# {
# "id": 1,
# "store_id": 1,
# "parent_product_id": null,
# "search_engine_data_id": null,
# "product_type_id": null,
# "thumbnail_id": null,
# "slug": "jb-product",
```
## Quick Reference
```
sc = Sugarcoat() # Create new Sugarcoat instance
sc.Product # Create Product wrapper
Product.list() # List all products
Product.read(1) # Read product with id 1
Product.create(payload) # Create product with passed payload
Product.update(1, payload) # Update product id 1 with passed payload
Product.delete(1) # Delete product id 1
```
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
sugarcoat-sdk-1.2.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for sugarcoat_sdk-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9841d8d72e29a2890526ea2e696857d40aeea16ece75098ba804db84f76a51f1 |
|
MD5 | af3a4c3f5c5802757ef441b1f30c7e9e |
|
BLAKE2b-256 | 4183da7ed72a2e10cc7132c3210c82fd42a953ad3cad6d53ad5697be225e2c9c |