Files

22 lines
686 B
Python

#!/usr/bin/env python3
"""Inline discrepancy check between manifest CSV and emitted TSV (ad hoc probe)."""
import csv
from collections import defaultdict
from pathlib import Path
man = defaultdict(int)
with open("/root/troupe-standup/wizard-work/ledger/wizardwork-census.csv") as f:
r = csv.reader(f)
next(r) # header
for row in r:
man[row[4]] += 1
print("manifest:", dict(man), "total", sum(man.values()))
s = defaultdict(int)
with open("/root/troupe-standup/wizard-work/ledger/wizardwork-census.tsv") as f:
next(f)
for line in f:
p = line.rstrip("\n").split("\t")
s[p[0]] = int(p[1])
print("emitted:", dict(s), "total", sum(s.values()))