"""Exploratory look (not a test): rows of EE_events.csv dated from 2026-10-20, and any row naming the four places.""" import sys, csv, io, re from urllib.parse import urlparse sys.stdout.reconfigure(encoding="utf-8") rows = list(csv.DictReader(io.StringIO(open(sys.argv[1], "rb").read().decode("utf-8")))) print("rows", len(rows), "date range", min(r["date_utc"] for r in rows), max(r["date_utc"] for r in rows)) print("sheet_row range", min(int(r["sheet_row"]) for r in rows), max(int(r["sheet_row"]) for r in rows)) print("\n--- rows dated 2026-10-20 or later ---") for r in sorted(rows, key=lambda r: (r["date_utc"], int(r["sheet_row"]))): if r["date_utc"] >= "2026-10-20": doms = ";".join(urlparse(u.strip()).netloc for u in re.split(r"[ |;,\n]+", r["source_links"]) if u.strip().startswith("http")) print(r["sheet_row"], r["date_utc"], r["date_certainty"], "|", r["description"][:260].replace("\n", " "), "|", doms) print("\n--- rows naming the four places ---") pat = re.compile(r"espinal|margarita|mahuabari|usiya|ghazipur|olkhan|jhunjhunu|vedado|havana|habana", re.I) for r in rows: blob = " ".join([r["description"], r["cause_text"], r["source_links"]]) if pat.search(blob): print(r["sheet_row"], r["date_utc"], r["date_certainty"], "|", pat.findall(blob), "|", r["description"][:200].replace("\n", " "))