A CLI-based runner for Shopify ETL pipelines, coordinating multi-client data fetches and reports (inventory, locations, orders, purchase orders) using Mongo-backed configuration and Shopify's GraphQL API.
This repository is a cleaned-up extraction from a larger production system. It's published as-is for reference and reuse, not as a general-purpose ETL framework or drop-in product.
Note: CI is being cleaned up after extraction; some checks may be temporarily noisy.
-
Create a virtualenv, then install:
pip install .(orpip install -e .[dev]for lint/test tools). -
Copy
.env.exampleto.envand set your Mongo URI / API version / output dirs as needed. -
Bootstrap Mongo (AdminDB + client DB):
python -m shopify_etl_runner.bootstrap \ --mongo-uri "mongodb://localhost:27017" \ --client-db "<client_db>" \ --client-code "<client_code>" \ --shop-name "<store>" \ --access-token "<token>" \ [--stocky-api-key ...]
See
docs/config.mdfor expected collections/fields. -
Run the runner:
-
Single step:
python -m shopify_etl_runner.runner --client <client_db> \ --step fetch_inventory
-
Grouped:
python -m shopify_etl_runner.runner --client <client_db> --fetches # or python -m shopify_etl_runner.runner --client <client_db> --reports
-
All clients:
python -m shopify_etl_runner.runner --all-clients --full
-
More examples:
runner_commands.md.
-
runner.py- CLI entrypoint and orchestration logic.bootstrap.py- helper to seed AdminDB/client DB collections and configs.core/- Shopify GraphQL client, Mongo helpers, logging, data transforms, report builders.pipelines/- thin wrappers for individual pipeline steps used by the runner.docs/config.md- Mongo/config reference and bootstrap examples.
- Environment variables: see
.env.example(defaults incore/config.py). - Config data lives in Mongo: AdminDB
Clientsand per-clientConfigurations(details indocs/config.md). - Report outputs default to
output/excelandoutput/csv(gitignored); override via.envor config.
- Lint:
ruff check . - Format:
black . - Types:
mypy . - Tests:
pytest - See
CONTRIBUTING.mdfor more.
MIT - see LICENSE.