Spaces:
Sleeping
Sleeping
Create ingest/discovery.py
Browse files- ingest/discovery.py +18 -0
ingest/discovery.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ingest.registry import get_all_adapters
|
| 2 |
+
|
| 3 |
+
def agency_discovery():
|
| 4 |
+
"""
|
| 5 |
+
Transparency-only discovery table.
|
| 6 |
+
"""
|
| 7 |
+
rows = []
|
| 8 |
+
for adapter in get_all_adapters():
|
| 9 |
+
rows.append({
|
| 10 |
+
"Agency": adapter.name,
|
| 11 |
+
"Status": "Live" if adapter.is_live else "Stub",
|
| 12 |
+
"Reason": (
|
| 13 |
+
"Public FOIA Reading Room"
|
| 14 |
+
if adapter.is_live
|
| 15 |
+
else "robots.txt blocked or no public endpoint"
|
| 16 |
+
)
|
| 17 |
+
})
|
| 18 |
+
return rows
|