Skip to content

Commit c28f2a9

Browse files
authored
Merge pull request OCHA-DAP#115 from OCHA-DAP/HDXDSYS-829-update-3w
Hdxdsys 829 Update 3W
2 parents aa1629a + c8e3aa4 commit c28f2a9

12 files changed

+247
-158
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## [0.9.18] - 2024-06-24
8+
9+
### Added
10+
11+
- Specify countries per theme when running via the command line
12+
13+
### Fixed
14+
15+
- Thanks to bugfix in `openpyxl`, added 3W data for: BFA, CAF, COD, NER
16+
- Updated 3W data for: MLI, SOM, ETH, SDN, SSD
17+
- Avoid overwriting orgs with multiple org types
18+
719
## [0.9.17] - 2024-06-10
820

921
### Changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ requires-python = ">=3.8"
3636
dependencies = [
3737
"hapi-schema>=0.8.9",
3838
"hdx-python-api>= 6.2.9",
39-
"hdx-python-country>= 3.7.2",
39+
"hdx-python-country>= 3.7.2, <3.7.3",
4040
"hdx-python-database[postgresql]>= 1.3.1",
4141
"hdx-python-scraper>= 2.3.7",
4242
"hdx-python-utilities>= 3.6.9",

requirements.txt

+14-15
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ckanapi==4.8
2424
# via hdx-python-api
2525
click==8.1.7
2626
# via typer
27-
coverage==7.5.3
27+
coverage==7.5.4
2828
# via pytest-cov
2929
cryptography==42.0.8
3030
# via pyopenssl
@@ -40,11 +40,11 @@ docopt==0.6.2
4040
# num2words
4141
docutils==0.21.2
4242
# via defopt
43-
email-validator==2.1.1
43+
email-validator==2.2.0
4444
# via hdx-python-api
4545
et-xmlfile==1.1.0
4646
# via openpyxl
47-
filelock==3.14.0
47+
filelock==3.15.4
4848
# via virtualenv
4949
frictionless==5.17.0
5050
# via hdx-python-utilities
@@ -71,9 +71,9 @@ hdx-python-country==3.7.2
7171
# hdx-python-scraper
7272
hdx-python-database==1.3.1
7373
# via hapi-pipelines (pyproject.toml)
74-
hdx-python-scraper==2.3.7
74+
hdx-python-scraper==2.3.8
7575
# via hapi-pipelines (pyproject.toml)
76-
hdx-python-utilities==3.6.9
76+
hdx-python-utilities==3.7.0
7777
# via
7878
# hapi-pipelines (pyproject.toml)
7979
# hdx-python-api
@@ -89,7 +89,7 @@ idna==3.7
8989
# requests
9090
ijson==3.3.0
9191
# via hdx-python-utilities
92-
inflect==7.2.1
92+
inflect==7.3.0
9393
# via quantulum3
9494
iniconfig==2.0.0
9595
# via pytest
@@ -118,7 +118,7 @@ makefun==1.15.2
118118
# via hdx-python-api
119119
markdown-it-py==3.0.0
120120
# via rich
121-
marko==2.0.3
121+
marko==2.1.2
122122
# via frictionless
123123
markupsafe==2.1.5
124124
# via jinja2
@@ -134,7 +134,7 @@ num2words==0.5.13
134134
# via quantulum3
135135
oauthlib==3.2.2
136136
# via requests-oauthlib
137-
openpyxl==3.1.3
137+
openpyxl==3.1.4
138138
# via hdx-python-utilities
139139
packaging==24.1
140140
# via pytest
@@ -166,7 +166,7 @@ pyasn1-modules==0.4.0
166166
# via google-auth
167167
pycparser==2.22
168168
# via cffi
169-
pydantic==2.7.3
169+
pydantic==2.7.4
170170
# via frictionless
171171
pydantic-core==2.18.4
172172
# via pydantic
@@ -190,7 +190,7 @@ pytest-cov==5.0.0
190190
# via hapi-pipelines (pyproject.toml)
191191
pytest-mock==3.14.0
192192
# via hapi-pipelines (pyproject.toml)
193-
python-dateutil==2.8.2
193+
python-dateutil==2.9.0.post0
194194
# via
195195
# frictionless
196196
# hdx-python-utilities
@@ -242,7 +242,7 @@ ruamel-yaml==0.18.6
242242
# via hdx-python-utilities
243243
ruamel-yaml-clib==0.2.8
244244
# via ruamel-yaml
245-
setuptools==70.0.0
245+
setuptools==70.1.0
246246
# via ckanapi
247247
shellingham==1.5.4
248248
# via typer
@@ -259,7 +259,7 @@ six==1.16.0
259259
# sphinxcontrib-napoleon
260260
sphinxcontrib-napoleon==0.7
261261
# via defopt
262-
sqlalchemy==2.0.30
262+
sqlalchemy==2.0.31
263263
# via
264264
# hapi-pipelines (pyproject.toml)
265265
# hapi-schema
@@ -281,7 +281,6 @@ typer==0.12.3
281281
typing-extensions==4.12.2
282282
# via
283283
# frictionless
284-
# inflect
285284
# psycopg
286285
# pydantic
287286
# pydantic-core
@@ -292,13 +291,13 @@ unidecode==1.3.8
292291
# via
293292
# libhxl
294293
# pyphonetics
295-
urllib3==2.2.1
294+
urllib3==2.2.2
296295
# via
297296
# libhxl
298297
# requests
299298
validators==0.28.3
300299
# via frictionless
301-
virtualenv==20.26.2
300+
virtualenv==20.26.3
302301
# via pre-commit
303302
wheel==0.43.0
304303
# via libhxl

src/hapi/pipelines/app/__main__.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ def parse_args():
5454
default=None,
5555
help="Database connection parameters. Overrides --db-uri.",
5656
)
57-
parser.add_argument("-th", "--themes", default=None, help="Themes to run")
57+
th_help = (
58+
"Themes to run. Can pass a single theme or multiple themes "
59+
"separated by commas. You can also append a colon to the "
60+
"theme name and pass ISO3s separated by a pipe. For example: "
61+
"population:AFG|COD,poverty_rate:BFA,funding"
62+
)
63+
parser.add_argument("-th", "--themes", default=None, help=th_help)
5864
parser.add_argument(
5965
"-sc", "--scrapers", default=None, help="Scrapers to run"
6066
)
@@ -181,7 +187,11 @@ def main(
181187
if len(theme_strs) == 1:
182188
themes_to_run[theme_strs[0]] = None
183189
else:
184-
themes_to_run[theme_strs[0]] = theme_strs[1]
190+
# Split values by pipe for multiple countries
191+
values = theme_strs[1].split("|")
192+
themes_to_run[theme_strs[0]] = (
193+
values if len(values) > 1 else values[0]
194+
)
185195
else:
186196
themes_to_run = None
187197
if args.scrapers:

src/hapi/pipelines/configs/core.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ org_type:
219219
org_type_map:
220220
academy: "431"
221221
agence un: "447"
222+
agence du systeme des nations unies: "447"
222223
autre type: "443"
223224
civile society: "501"
224225
cooperation internationale: "501"
@@ -229,9 +230,11 @@ org_type_map:
229230
gov: "435"
230231
govt: "435"
231232
ingo: "437"
233+
institution etatique: "435"
232234
international institution: "438"
233235
local ngo: "504"
234236
mouv cr: "445"
237+
mouvement croix rouge: "445"
235238
mouvement de la croix rouge: "445"
236239
movimiento de la cruz roja media luna roja: "445"
237240
nations unies: "447"
@@ -242,6 +245,7 @@ org_type_map:
242245
ong internacional: "437"
243246
ong internationale: "437"
244247
ong nat: "441"
248+
ong national: "441"
245249
ong nacional: "441"
246250
ong nationale: "441"
247251
organisation des nations unies: "447"
@@ -262,8 +266,11 @@ org_type_map:
262266

263267
sector_map:
264268
abna: "SHL"
269+
abri: "SHL"
270+
abri bna: "SHL"
265271
abris: "SHL"
266272
abris ame: "SHL"
273+
abris/ame: "SHL"
267274
abris/bna: "SHL"
268275
abris/bna/cccm: "SHL"
269276
abris / nfi: "SHL"
@@ -273,6 +280,7 @@ sector_map:
273280
agriculture: "FSC"
274281
agua saneamiento e higiene: "WSH"
275282
all: "Intersectoral"
283+
ame: "SHL"
276284
alojamiento de emergencia: "SHL"
277285
alojamiento de emergencia (shelter): "SHL"
278286
alojamientos y asentamientos: "SHL"
@@ -302,16 +310,20 @@ sector_map:
302310
epah: "WSH"
303311
erl: "ERY"
304312
esnfi: "SHL"
313+
explosive hazards: "PRO-MIN"
305314
food: "FSC"
306315
food security and agriculture: "FSC"
307316
food security and livelihoods: "FSC"
308317
food security and nutrition: "FSC"
309318
food security livelihood: "FSC"
310319
fsl: "FSC"
320+
gestion des sites d'accueil temporaires: "SHL"
311321
gbv: "PRO-GBV"
322+
hlp: "PRO-HLP"
312323
humanitaire: "Hum"
313324
hygiene: "WSH"
314325
hygiene assainissement: "WSH"
326+
intercluster: "Multi" # From Somalia 3W, hopefully not to be confused with intersectoral
315327
logement terre et biens: "PRO-HLP"
316328
logistica: "LOG"
317329
logistique: "LOG"
@@ -330,11 +342,17 @@ sector_map:
330342
operational presence protection: "PRO"
331343
pronna: "PRO-CPN"
332344
propg: "PRO"
345+
proteccion infantil: "PRO-CPN"
333346
protection: "PRO"
334347
protection de l'enfance: "PRO-CPN"
335348
protection de l'enfant: "PRO-CPN"
336349
protection generale: "PRO"
337-
proteccion infantil: "PRO-CPN"
350+
protection logement terre et propriete: "PRO-HLP"
351+
protection ltb: "PRO-HLP"
352+
protection lutte anti mines: "PRO-MIN"
353+
protection protection de l'enfant: "PRO-CPN"
354+
protection violences basees sur le genre: "PRO-GBV"
355+
protection vgb: "PRO-GBV"
338356
proteccion: "PRO"
339357
provbg: "PRO-GBV"
340358
psea: "PRO-GBV"
@@ -368,6 +386,7 @@ sector_map:
368386
shelter and non food items: "SHL"
369387
site management: "CCM"
370388
snfi: "SHL"
389+
telecommunications: "TEL"
371390
telecomunicaciones de emergencia: "TEL"
372391
telecommunications d'urgence: "TEL"
373392
vbg: "PRO-GBV"

0 commit comments

Comments
 (0)