File size: 1,657 Bytes
5567216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# PRWP Dataset Extraction Dashboard Generator

This folder contains the scripts and canonical metadata mapping artifacts required to regenerate the database payload for the **PRWP Dataset Extraction Dashboard**.

## Directory Layout

```text
ai4data/docs/dashboards/prwp_extraction/
β”œβ”€β”€ index.html                  # Static dashboard frontend
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ dashboard_data.json     # Generated JSON payload
β”‚   └── dashboard_data.js       # Serialized JS variables payload (loaded by index.html)
└── generation/                 # Generator tools & scripts (this folder)
    β”œβ”€β”€ generate_dashboard_data.py  # Main database payload generator
    β”œβ”€β”€ run_harmonization.py        # Entity clustering/harmonization script
    β”œβ”€β”€ canonical_map.json          # Pre-compiled canonical mapping file
    β”œβ”€β”€ dataset_families.json       # Dataset families lookup file
    └── README.md                   # This instruction file
```

## Running the Data Compilation

To recompile the dashboard data payload after updating any raw extraction batches:

1. Navigate to the `ai4data/` repository root:
   ```bash
   cd /Users/rafaelmacalaba/WBG/ai4data
   ```

2. Run the generator script using `uv`:
   ```bash
   uv run python docs/dashboards/prwp_extraction/generation/generate_dashboard_data.py
   ```

This will read the raw standardized JSON output files from `/Users/rafaelmacalaba/WBG/fetch_prwp/data/standardized_outputs`, apply the canonical name mappings, compute metrics, and write the updated `dashboard_data.json` and `dashboard_data.js` directly to `docs/dashboards/prwp_extraction/data/`.