Shopify is a Canadian e-commerce company headquartered in Ottawa, Ontario, that develops computer software for online stores and retail point-of-sale systems. Source Wikipedia
In this article, we will demonstrate how easy it is to extract and manipulate Shopify data.
1) Create Shopify account at www.shopify.com
2 ) Log in
3 ) Click apps
4) Click Private Apps
5) Create new Private App
6) Note API key and passport we will need them later
1) Download and install python 2.7 version 32 bit for 32-bit version or 64 bit for 64-bit version of ETL software.
2) Once installed run the following command from the command line
python.exe pip install requests
That will install requests python package
We now ready to extract the data.
Run Advanced ETL Processor Enterprise
Create a new package, add Script Action and make sure that language used is set Python
Enter this code, do not forget to replace SHOPNAME, KEY and PASSWORD
import requestsresponse = requests.get( "https://SHOPNAME.myshopify.com/admin/orders.xml", auth=("KEY","PASSWORD"))file = open("orders.xml", "w")file.write(response.text)file.close()
Data can be extracted as XML or as JSON, just replace file extension XML with JSON. Once data is saved on the local drive it can be loaded into the database
At the moment it can be only executed from the package script object.
Python integration is on very early stages and we still working on making it better.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. It's high-level built-in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms and can be freely distributed.
Copyright © 2022 ETL-tools.com. All Rights Reserved.