(rec: dict, fields: list[str])
| 75 | |
| 76 | # --- 4. dedup / entity key |
| 77 | def record_key(rec: dict, fields: list[str]) -> str: |
| 78 | raw = "|".join(str(rec.get(f, "")).strip().lower() for f in fields) |
| 79 | return hashlib.sha256(raw.encode()).hexdigest()[:16] |
| 80 | |
| 81 | |
| 82 | # --- 5. durable incremental store (SQLite upsert; idempotent re-runs) |
no test coverage detected