sudo apt-get install python3-pip
sudo pip3 install virtualenv
service: Shopify-InventoryLevel | |
provider: | |
name: aws | |
runtime: python3.6 | |
stage: ${opt:stage, 'dev'} | |
region: us-east-1 | |
environment: | |
REDSHIFT_HOST: ${file(../config.json):REDSHIFT_HOST} | |
REDSHIFT_PORT: ${file(../config.json):REDSHIFT_PORT} |
import json | |
import requests | |
class ShopifyClient: | |
def __init__(self, client_id, client_secret): | |
self.domain = "xxxxxxx.myshopify.com" | |
self.base_url = "https://{}:{}@{}/admin/api/2020-04/".format(client_id, client_secret, self.domain) | |
self.session = requests.Session() | |
self.session.headers.update({'content-type': 'application/json'}) |