Spaces:
Sleeping
Sleeping
Download scripts/shopify_ingest_cli.py from Qurrah/replyflow-rag: direct link, hf CLI and curl.
- Browser
- Download file 967 Bytes
-
https://huggingface.co/spaces/Qurrah/replyflow-rag/resolve/main/scripts/shopify_ingest_cli.py
- Command line
-
hf download hf://spaces/Qurrah/replyflow-rag/scripts/shopify_ingest_cli.py
-
curl -L -o shopify_ingest_cli.py https://huggingface.co/spaces/Qurrah/replyflow-rag/resolve/main/scripts/shopify_ingest_cli.py
967 Bytes
| import argparse | |
| import logging | |
| from services.shopify_ingest_service import reindex_all, reindex_brand, sync_new_workspace | |
| def parse_args() -> argparse.Namespace: | |
| parser = argparse.ArgumentParser(description="Sync or re-index Shopify workspace policies.") | |
| parser.add_argument("--reindex", metavar="SLUG", help="Force re-index one workspace slug.") | |
| parser.add_argument("--reindex-all", action="store_true", help="Re-index every workspace.") | |
| return parser.parse_args() | |
| def main() -> None: | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s | %(levelname)s | %(name)s | %(message)s", | |
| ) | |
| args = parse_args() | |
| if args.reindex and args.reindex_all: | |
| raise SystemExit("Use either --reindex or --reindex-all, not both.") | |
| if args.reindex: | |
| reindex_brand(args.reindex) | |
| elif args.reindex_all: | |
| reindex_all() | |
| else: | |
| sync_new_workspace() | |
| if __name__ == "__main__": | |
| main() | |