New to using anvil and have been very impressed with it so far. I’m wanting to pull some basic information from shopify and it looks like I have 2 options. #1, pull json calls with requests or #2 import the shopifyAPI library.
pip install --upgrade ShopifyAPI
import shopify
if I wanted to use the shopifyAPI library, how would I do that using anvil?
Would I need to copy the code from the GIT repo and upload as a local module?
It depends on where the API-calling code will run.
Python code running on your own computer can use anything you care to install. You’d also need to install Anvil’s Uplink library (Anvil Docs | Uplink: Code outside Anvil), to communicate the results back to your Anvil app.
Python code running on Anvil’s Servers (Anvil Docs | Server Code) can also use third-party libraries. The list of pre-installed libraries is here: Anvil Docs | List of Packages . I didn’t see Shopify among them, but the Anvil folks will often install such libraries for you, on your request.
Python code running in the end-user’s browser usually can’t use such third-party libraries directly. However, it can call Server-side or Uplink-side code (Anvil Docs | Server Code), that can.
Thanks! I may start by using uplink and running locally, then if the app works as expected will reach out to the anvil team and running it on an anvil server.
Just wanted to make sure I didn’t miss some simple way to run it on anvils servers.
Even when running it on Anvil’s servers, it is often helpful to first develop and run your code locally, i.e., where you have a Python IDE and debugger to help you.
This can greatly reduce server-side problems for you (and Anvil).