--- title: ShopifyQL Python SDK and CLI description: >- Access ShopifyQL data through a dedicated Python SDK and CLI tool designed for analytics workflows. source_url: html: 'https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli' md: 'https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md' --- ExpandOn this page * [Installation](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#installation) * [Quick start](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#quick-start) * [Working with pandas](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#working-with-pandas) * [Jupyter notebook template](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#jupyter-notebook-template) * [Next steps](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#next-steps) # ShopifyQL Python SDK and CLI You can access ShopifyQL data through a dedicated Python SDK and CLI tool designed for analytics workflows. The `shopifyql` Python package provides a clean, Pythonic interface for ShopifyQL queries while handling GraphQL API complexity behind the scenes. It eliminates manual OAuth implementation and HTTP request handling, returning data directly as pandas DataFrames. This enables developers to create reporting apps and export store data to data warehouses without managing GraphQL interactions directly. *** ## Installation To install the base package, run: ## Terminal ```shell pip install shopifyql ``` Or you can include support for pandas and polars DataFrames: ## Terminal ```shell pip install "shopifyql[all]" ``` *** ## Quick start Use the Python SDK to query ShopifyQL data: ## Python ```python from shopifyql import ShopifyQLClient client = ShopifyQLClient(shop="your-shop", access_token="shpat_...") records = client.query("FROM sales SHOW total_sales SINCE -3m GROUP BY month ORDER BY month") ``` *** ## Working with pandas For data analysis workflows, get results directly as pandas DataFrames: ## Python ```python from shopifyql import ShopifyQLClient client = ShopifyQLClient(shop="your-shop", access_token="shpat_...") df = client.query_pandas("FROM sales SHOW total_sales SINCE -3m GROUP BY month ORDER BY month") print(df.head()) ``` This makes it easy to create reporting apps and export store data to data warehouses without managing GraphQL interactions directly. *** ## Jupyter notebook template The fastest way to get started is with the CLI template that sets up a complete development environment: ## Terminal ```shell shopify app init --template=https://github.com/Shopify/shopify-app-notebooks-template ``` This template provides: * Pre-configured Python 3.11+ environment with Jupyter notebooks. * Automatic app configuration and authentication. * All necessary dependencies installed. * Ready-to-use development environment powered by Shopify CLI. *** ## Next steps [ShopifyQL Python SDK\ \ ](https://github.com/Shopify/shopifyql-py) [Python library for ShopifyQL with pandas integration and CLI tools.](https://github.com/Shopify/shopifyql-py) [ShopifyQL syntax reference\ \ ](https://shopify.dev/docs/api/shopifyql) [Complete reference for all ShopifyQL keywords, operators, and functions.](https://shopify.dev/docs/api/shopifyql) *** * [Installation](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#installation) * [Quick start](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#quick-start) * [Working with pandas](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#working-with-pandas) * [Jupyter notebook template](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#jupyter-notebook-template) * [Next steps](https://shopify.dev/docs/apps/build/shopifyql/python-sdk-and-cli.md#next-steps)