#!/usr/bin/env python3 """E0b: daily bars (market_bars.stock.1d.raw) 2015-01-01…2024-12-31 for the E0 universe (≤ 10 years per request) → longer daily return histories for E3 (GARCH). Output experiments/results/e0_daily.json.""" import os, sys, json, time sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "python")) import raid e0 = json.load(open(os.path.join(os.path.dirname(__file__), "..", "results", "e0_universe.json"))); syms = e0["samples"]["1000"] exports = []; t0 = time.time() for i in range(0, len(syms), 100): chunk = syms[i:i + 100]; e = raid.findata.export(chunk, "2015-01-01", "2024-12-31", dataset_id="market_bars.stock.1d.raw") exports.append({"symbols": chunk, **{k: e[k] for k in ("export_id", "path", "sha256", "dataset_version", "rows", "bytes", "from_cache")}}); print(f"daily export {i // 100 + 1}/10: {e['rows']:,} rows {e['bytes'] / 1e6:.1f} MB", flush=True) json.dump({"dataset_id": "market_bars.stock.1d.raw", "start": "2015-01-01", "end": "2024-12-31", "exports": exports, "total_rows": sum(x["rows"] for x in exports), "seconds": time.time() - t0}, open(os.path.join(os.path.dirname(__file__), "..", "results", "e0_daily.json"), "w"), indent=1) print("done", sum(x["rows"] for x in exports), "rows", round(time.time() - t0, 1), "s")