Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccrvlh/shopipy
An alternative to the official Shopify API Wrapper
https://github.com/ccrvlh/shopipy
Last synced: 24 days ago
JSON representation
An alternative to the official Shopify API Wrapper
- Host: GitHub
- URL: https://github.com/ccrvlh/shopipy
- Owner: ccrvlh
- License: mit
- Created: 2021-10-13T12:00:53.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-17T22:50:04.000Z (about 3 years ago)
- Last Synced: 2023-08-08T18:10:08.138Z (about 1 year ago)
- Language: Python
- Size: 151 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Usage
NOT PRODUCTION READY
### For public apps:
```python
from shopipy import ShopiPyapi_key = "MY_API_KEY"
api_secret = "MY_API_SECRET"shopify = ShopiPy(api_key=api_key, api_secret=api_secret)
# OAuth Flow
shop_domain = "MY_SHOP_DOMAIN"
state = "my_super_secret_key"
redirect_uri = "https://myapp.com/callback"
scopes = ['read_products', 'read_orders']auth_url = shopify.OAuth.create_permission_url(
shop_domain=shop_domain,
scopes=scopes,
redirect_uri=redirect_uri,
state=state
)# Request Token from the Shopify request to the callback URL
request_params = {}
shopify = ShopiPy(shop_domain=shop_domain, api_key=api_key, api_secret=api_secret)
access_token = shopify.OAuth.request_token(request_params)# Make an authenticated request
# access_token = ShopifyAppDB.query.first_by(shop_domain=shop_domain).first()
shopify = ShopiPy(shop_domain=shop_domain, access_token=access_token)
product_list = shopify.Products.list_products()
orders_count = shopify.Orders.count(status="open")
```### For private apps:
```python
from shopipy import ShopiPy
# Set Credentials
private_key = "MY_APP_KEY"
private_password = "MY_APP_PASSWORD"
shop_domain = "MY_SHOP_DOMAIN"# Instanciates client
shopify = ShopiPy(shop_domain=shop_domain, app_key=private_key, app_password=private_password)# Retrieve information
product = shopify.Products.get("432432432432")
orders = shopify.Orders.count()
```