From da49fd870dd51c8daf9079caee46047525a05043 Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Wed, 1 Dec 2021 14:11:23 +0100 Subject: [PATCH 1/3] Add a mapping between sector categories and humanitarian clusters, fixes #50 --- importers/sector_humanitarian_cluster.py | 19 +++++++++++++++++++ ...ectorCategoryHumanitarianGlobalCluster.xml | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 importers/sector_humanitarian_cluster.py create mode 100644 templates/SectorCategoryHumanitarianGlobalCluster.xml diff --git a/importers/sector_humanitarian_cluster.py b/importers/sector_humanitarian_cluster.py new file mode 100644 index 0000000..22c4d0a --- /dev/null +++ b/importers/sector_humanitarian_cluster.py @@ -0,0 +1,19 @@ +import csv + +from .helpers import Importer, fetch + + +def run(): + url = 'https://gist.githubusercontent.com/markbrough/57106a152dbb26a6f4544a77c6768a64/raw/1978f2094f4a80c575ed8017cd4915274f4641ed/dac5-clusters-mapping.csv' + lookup = [ + ('code', 'code'), + ('name', 'name'), + ('category', 'cluster_code'), + ('codeforiati:cluster', 'cluster_name'), + ] + + Importer('SectorCategoryHumanitarianGlobalCluster', url, lookup) + + +if __name__ == '__main__': + run() diff --git a/templates/SectorCategoryHumanitarianGlobalCluster.xml b/templates/SectorCategoryHumanitarianGlobalCluster.xml new file mode 100644 index 0000000..6304419 --- /dev/null +++ b/templates/SectorCategoryHumanitarianGlobalCluster.xml @@ -0,0 +1,14 @@ + + + + DAC Sector Category and Humanitarian Cluster Mappings + + + Mapping between DAC Sector Categories and Humanitarian Clusters. Improvements to this codelist are welcome! + + + Maintained + + + + From 2bbfddabf34485fac0f3ce250f50f5265b5e5955 Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Wed, 1 Dec 2021 14:12:29 +0100 Subject: [PATCH 2/3] Run sector/humanitarian clusters mapping --- .github/workflows/import.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/import.yml b/.github/workflows/import.yml index 82442ea..4cfb7bb 100644 --- a/.github/workflows/import.yml +++ b/.github/workflows/import.yml @@ -47,6 +47,8 @@ jobs: repo: Unofficial-Codelists - importer: sector_groups repo: Unofficial-Codelists + - importer: sector_humanitarian_cluster + repo: Unofficial-Codelists name: "Run importer: ${{ matrix.importer }}" runs-on: ubuntu-latest steps: From 3e7ebf41f30a127dc244ec696ad624e166b71b55 Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Wed, 1 Dec 2021 14:21:04 +0100 Subject: [PATCH 3/3] Don't pin gist commit --- importers/sector_humanitarian_cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/importers/sector_humanitarian_cluster.py b/importers/sector_humanitarian_cluster.py index 22c4d0a..87fe533 100644 --- a/importers/sector_humanitarian_cluster.py +++ b/importers/sector_humanitarian_cluster.py @@ -4,7 +4,7 @@ def run(): - url = 'https://gist.githubusercontent.com/markbrough/57106a152dbb26a6f4544a77c6768a64/raw/1978f2094f4a80c575ed8017cd4915274f4641ed/dac5-clusters-mapping.csv' + url = 'https://gist.githubusercontent.com/markbrough/57106a152dbb26a6f4544a77c6768a64/raw/dac5-clusters-mapping.csv' lookup = [ ('code', 'code'), ('name', 'name'),