Thanks for helping keep this dataset accurate. Fixes to names, postal codes, and daïra mappings are all welcome — no contribution is too small.
Only edit data/algeria.json. It's the single source of truth. Every other file (wilayas.json, dairas.json, communes.json, by-wilaya/NN.json) is derived from it. If you edit a derived file by hand, CI will fail because the counts won't line up.
If you're not comfortable editing JSON, just open an issue and tell us:
- The wilaya (number or name)
- The commune (and daïra, if relevant)
- What's wrong and what it should be — a source or link helps a lot
That's enough for someone else to make the fix.
- Fork the repo and create a branch.
- Edit the relevant entry in
data/algeria.json. - If your change adds or removes a commune/daïra, update the affected
nb_communes/nb_dairascounts so they stay consistent. - Regenerate the derived files (see below).
- Run the checks locally (optional but appreciated).
- Commit and open the PR.
After editing data/algeria.json, rebuild the flat and per-wilaya files with jq:
# flat wilayas
jq '{langues, nb_wilayas, wilayas: [.wilayas[] | {wilaya_num, code, nom_ar, nom_fr, nom_en, nb_dairas, nb_communes}]}' \
data/algeria.json > data/wilayas.json
# flat dairas
jq '{nb_dairas, dairas: [.wilayas[] as $w | $w.dairas[] | {wilaya_num: $w.wilaya_num, wilaya_code: $w.code, wilaya_fr: $w.nom_fr, wilaya_en: $w.nom_en, nom_ar, nom_fr, nom_en, nb_communes}]}' \
data/algeria.json > data/dairas.json
# flat communes
jq '{nb_communes, communes: [.wilayas[] as $w | $w.dairas[] as $d | $d.communes[] | {wilaya_num: $w.wilaya_num, wilaya_code: $w.code, wilaya_ar: $w.nom_ar, wilaya_fr: $w.nom_fr, wilaya_en: $w.nom_en, daira_ar: $d.nom_ar, daira_fr: $d.nom_fr, daira_en: $d.nom_en, nom_ar, nom_fr, nom_en, code_postal}]}' \
data/algeria.json > data/communes.json
# per-wilaya files
for i in $(seq 1 69); do
nn=$(printf "%02d" "$i")
jq --argjson n "$i" '.wilayas[] | select(.wilaya_num == $n)' data/algeria.json > "data/by-wilaya/${nn}.json"
done# integrity (counts, codes, cross-checks) — no dependencies
python3 scripts/validate.py
# schema validation (needs: pipx install check-jsonschema)
check-jsonschema --schemafile schema/algeria.schema.json data/algeria.jsonBoth must pass. The same checks run automatically in CI on every push and pull request.
- Every commune, daïra, and wilaya has
nom_ar,nom_fr, andnom_en. nom_enmatchesnom_frunless there's a genuine English exonym (e.g. Algiers).code_postalis a 5-digit string, ornullif unknown. Please don't guess — anullis better than a wrong code.- Wilaya
codeis the 2-digit zero-padded form ofwilaya_num(e.g.1→"01").
Because the 2025/2026 reform split some daïras across new wilayas, a daïra name can legitimately appear under more than one wilaya. If you believe a commune is under the wrong wilaya or daïra after the reform, please cite the official text (Loi 26-06 / Journal Officiel) in your issue or PR so it can be verified.
By contributing, you agree that your contributions are released under the same CC0 1.0 dedication as the rest of the project.