https://github.com/leocxy/flask-shopify-utils
An SDK for Flask to create a Shopify custom app.
https://github.com/leocxy/flask-shopify-utils
flask python sdk shopify shopify-app shopify-apps-custom
Last synced: 5 months ago
JSON representation
An SDK for Flask to create a Shopify custom app.
- Host: GitHub
- URL: https://github.com/leocxy/flask-shopify-utils
- Owner: leocxy
- License: mit
- Created: 2023-05-26T04:37:43.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2026-01-29T02:24:48.000Z (5 months ago)
- Last Synced: 2026-01-29T18:53:26.121Z (5 months ago)
- Topics: flask, python, sdk, shopify, shopify-app, shopify-apps-custom
- Language: Python
- Homepage:
- Size: 927 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask-Shopify-Utils
[](https://github.com/leocxy/flask-shopify-utils/actions/workflows/PluginForFlask.yml?query=branch%3Amaster)
[](https://github.com/leocxy/flask-shopify-utils/actions/workflows/PluginForFlask.yml?query=branch%3Amaster)
[](https://github.com/leocxy/flask-shopify-utils/actions/workflows/PluginForFlask.yml?query=branch%3Amaster)
[](https://github.com/leocxy/flask-shopify-utils/actions/workflows/PluginForFlask.yml?query=branch%3Amaster)
[](https://github.com/leocxy/flask-shopify-utils/actions/workflows/PluginForFlask.yml?query=branch%3Amaster)
The utils for Flask Application that build for Shopify Custom App
---
# Installing
```shell
$pip install -U flask-shopify-utils
```
## Get the sample code to start
After install the "flask-shopify-utils", you should able to get the sample code by running the following command.
```shell
$lazy-dog
```
---
## Example / How to ...
Please check the `example` folder for more details.
Remember, this package is using Flask-SQLAlchemy, so you need to initialize the database first.
```python
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_shopify_utils import ShopifyUtil
app = Flask(__name__)
# Init Database
db = SQLAlchemy()
db.init_app(app)
# Initial Shopify Utils
utils = ShopifyUtil()
utils.init_app(app)
# example: register default routes
utils.enroll_default_route()
```
---
## Donate
Well, I have no idea how this work, just copy it from somewhere.
The Pallets organization develops and supports Flask and the libraries
it uses. In order to grow the community of contributors and users, and
allow the maintainers to devote more time to the projects, [please
donate today](https://palletsprojects.com/donate)
---
## First time setup
- Download the repository to your local machine.
- Create a virtualenv.
```shell
# Linux/macOS
$ python3 -m venv env
$ . env/bin/active
# Window
$ py -3 -m venv env
$ env/Scripts/active
```
- Install `pip-tools`, `twine` and `build` in the virtualenv.
```shell
>pip install --upgrade pip
>pip install pip-tools twine build
```
- Install the development dependencies, then install `Flask-ShopifyUtils` in editable mode.
```sheel
$ pip install -r requirements/dev.txt && pip install -e .
```
- Build the wheel
```shell
# new
>python -m build
# For more reference https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html
```
- Deploy to PyPI
```shell
# check
>twine check dist/*
# upload
>twine upload dist/* --skip-existing
```
## requirements.txt
All dependencies are managed by `pip-tools`, so you need to install it first.
And you can find them from the `requirements` folder.
```shell
# development
>pip-compile --extra=dev --output-file=requirements/dev.txt pyproject.toml
# production
>pip-compile --output-file=requirements/index.txt pyproject.toml
````
## Check the code format
```shell
>flake8
```
## Running the tests
Make sure you have install the repository locally.
```shell
# install the package
>pip install -e .
# install the pytest
>pip install pytest
# run all tests
>pytest
# run tests with output
>pytest -s
# run specific test
>pytest -vs tests/test_init.py
# run specific test case
>pytest -vs tests/test_init.py::test_init_app
```
---
# Reference
[Packing for Python](https://packaging.python.org/en/latest/tutorials/installing-packages/)
# TODO
[] Remove state from check_callback method
[] Remove state cookie form intall method
Add test for `ShopifyUtil` methods