First commit

This commit is contained in:
2025-09-02 22:21:05 -03:00
parent 08fc532e4b
commit 3e3eee8ebf
20 changed files with 5 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
def pick_golden(rows):
if not rows: return {}
def score(r): return (5 if r.get("source") in ("ERP","CRM") else 0) + sum(1 for v in r.values() if v not in (None,"",[],{}))
best = max(rows, key=score)
gold = dict(best)
for r in rows:
for k,v in r.items():
if gold.get(k) in (None,"",[],{}) and v not in (None,"",[],{}):
gold[k]=v
return gold