#!/usr/bin/env python3 """One-shot browse of the GW Algolia index -> gwshop_raw.json (gitignored).""" import json import logging import pathlib import sys sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent)) import dlphelper.gwshop as gw logging.basicConfig(level=logging.INFO, format="%(levelname)s %(message)s") app, key = gw.load_credentials() client = gw.GwShopClient(app, key) hits = client.browse("prod-lazarus-product-en-ww", hits_per_page=100) print("total hits", len(hits)) pathlib.Path("gwshop_raw.json").write_text( json.dumps(hits, ensure_ascii=False), encoding="utf-8" ) print("written gwshop_raw.json")