Spaces:
Sleeping
Sleeping
Create ingest/coverage.py
Browse files- ingest/coverage.py +16 -4
ingest/coverage.py
CHANGED
|
@@ -1,5 +1,17 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def coverage_summary(results):
|
| 2 |
+
"""
|
| 3 |
+
Aggregate-only coverage summary.
|
| 4 |
+
No tracking, no per-user analytics.
|
| 5 |
+
"""
|
| 6 |
+
counts = {}
|
| 7 |
+
for r in results:
|
| 8 |
+
agency = r.get("agency", "Unknown")
|
| 9 |
+
counts[agency] = counts.get(agency, 0) + 1
|
| 10 |
|
| 11 |
+
return [
|
| 12 |
+
{
|
| 13 |
+
"Agency": agency,
|
| 14 |
+
"Result Count": count
|
| 15 |
+
}
|
| 16 |
+
for agency, count in sorted(counts.items())
|
| 17 |
+
]
|