mws-lab 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mws_lab/__init__.py ADDED
@@ -0,0 +1,17 @@
1
+ """mws-lab — Morocco Water Scarcity Analysis Package.
2
+
3
+ Version: 1.0.0
4
+ Zenodo DOI: 10.5281/zenodo.23884236
5
+ Figshare DOI: 10.6084/m9.figshare.34884417
6
+ Website: https://mws-lab.netlify.app
7
+ PyPI: https://pypi.org/project/mws-lab/
8
+ """
9
+
10
+ __version__ = "1.0.0"
11
+ __author__ = "Samir Baladi"
12
+ __email__ = "gitdeeper@gmail.com"
13
+ __orcid__ = "https://orcid.org/0009-0003-8903-0029"
14
+ __doi__ = "10.5281/zenodo.23884236"
15
+ __figshare__ = "10.6084/m9.figshare.34884417"
16
+ __website__ = "https://mws-lab.netlify.app"
17
+ __pypi__ = "https://pypi.org/project/mws-lab/"
@@ -0,0 +1,8 @@
1
+ {
2
+ "truth_score": 100,
3
+ "evaluation": {
4
+ "truth_score": 100
5
+ },
6
+ "project": "Morocco_Water_Scarcity",
7
+ "timestamp": "2026-11-02T11:40:38.819257"
8
+ }
@@ -0,0 +1,131 @@
1
+ country_code,country_name,year,indicator_code,indicator_name,value,unit,obs_status,decimal,source_note,source_organization
2
+ MA,Morocco,2000,AG.LND.ARBL.ZS,Arable land (% of land area),19.6437373963702,,,1,Arable land (% of land area),
3
+ MA,Morocco,2000,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
4
+ MA,Morocco,2000,AG.YLD.CREL.KG,Cereal yield (kg per hectare),366.8,,,0,Cereal yield (kg per hectare),
5
+ MA,Morocco,2000,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),12.6,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
6
+ MA,Morocco,2000,SP.POP.GROW,Population growth (annual %),1.40392630100829,,,1,Population growth (annual %),
7
+ MA,Morocco,2001,AG.LND.ARBL.ZS,Arable land (% of land area),19.0185973560385,,,1,Arable land (% of land area),
8
+ MA,Morocco,2001,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
9
+ MA,Morocco,2001,AG.YLD.CREL.KG,Cereal yield (kg per hectare),894.6,,,0,Cereal yield (kg per hectare),
10
+ MA,Morocco,2001,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),13.7065,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
11
+ MA,Morocco,2001,SP.POP.GROW,Population growth (annual %),1.36697144784375,,,1,Population growth (annual %),
12
+ MA,Morocco,2002,AG.LND.ARBL.ZS,Arable land (% of land area),18.8259018597356,,,1,Arable land (% of land area),
13
+ MA,Morocco,2002,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
14
+ MA,Morocco,2002,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1068.7,,,0,Cereal yield (kg per hectare),
15
+ MA,Morocco,2002,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),14.813,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
16
+ MA,Morocco,2002,SP.POP.GROW,Population growth (annual %),1.32213816814169,,,1,Population growth (annual %),
17
+ MA,Morocco,2003,AG.LND.ARBL.ZS,Arable land (% of land area),20.2890432444544,,,1,Arable land (% of land area),
18
+ MA,Morocco,2003,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
19
+ MA,Morocco,2003,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1432.9,,,0,Cereal yield (kg per hectare),
20
+ MA,Morocco,2003,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),14.283,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
21
+ MA,Morocco,2003,SP.POP.GROW,Population growth (annual %),1.27031081599857,,,1,Population growth (annual %),
22
+ MA,Morocco,2004,AG.LND.ARBL.ZS,Arable land (% of land area),18.3956979610128,,,1,Arable land (% of land area),
23
+ MA,Morocco,2004,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.29746013781166,,,1,Agricultural irrigated land (% of total agricultural land),
24
+ MA,Morocco,2004,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1512.1,,,0,Cereal yield (kg per hectare),
25
+ MA,Morocco,2004,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),13.753,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
26
+ MA,Morocco,2004,SP.POP.GROW,Population growth (annual %),1.28219021585352,,,1,Population growth (annual %),
27
+ MA,Morocco,2005,AG.LND.ARBL.ZS,Arable land (% of land area),18.1985211740981,,,1,Arable land (% of land area),
28
+ MA,Morocco,2005,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.3049118009937,,,1,Agricultural irrigated land (% of total agricultural land),
29
+ MA,Morocco,2005,AG.YLD.CREL.KG,Cereal yield (kg per hectare),783.9,,,0,Cereal yield (kg per hectare),
30
+ MA,Morocco,2005,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),13.223,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
31
+ MA,Morocco,2005,SP.POP.GROW,Population growth (annual %),1.34347301576107,,,1,Population growth (annual %),
32
+ MA,Morocco,2006,AG.LND.ARBL.ZS,Arable land (% of land area),18.068563746359,,,1,Arable land (% of land area),
33
+ MA,Morocco,2006,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),3.87998397114807,,,1,Agricultural irrigated land (% of total agricultural land),
34
+ MA,Morocco,2006,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1652.1,,,0,Cereal yield (kg per hectare),
35
+ MA,Morocco,2006,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),12.693,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
36
+ MA,Morocco,2006,SP.POP.GROW,Population growth (annual %),1.35136550551358,,,1,Population growth (annual %),
37
+ MA,Morocco,2007,AG.LND.ARBL.ZS,Arable land (% of land area),18.0708043916648,,,1,Arable land (% of land area),
38
+ MA,Morocco,2007,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.08611481975968,,,1,Agricultural irrigated land (% of total agricultural land),
39
+ MA,Morocco,2007,AG.YLD.CREL.KG,Cereal yield (kg per hectare),516.4,,,0,Cereal yield (kg per hectare),
40
+ MA,Morocco,2007,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),12.163,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
41
+ MA,Morocco,2007,SP.POP.GROW,Population growth (annual %),1.34058101398506,,,1,Population growth (annual %),
42
+ MA,Morocco,2008,AG.LND.ARBL.ZS,Arable land (% of land area),18.0416760026888,,,1,Arable land (% of land area),
43
+ MA,Morocco,2008,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.39278209532704,,,1,Agricultural irrigated land (% of total agricultural land),
44
+ MA,Morocco,2008,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1002.9,,,0,Cereal yield (kg per hectare),
45
+ MA,Morocco,2008,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),11.633,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
46
+ MA,Morocco,2008,SP.POP.GROW,Population growth (annual %),1.33869604527126,,,1,Population growth (annual %),
47
+ MA,Morocco,2009,AG.LND.ARBL.ZS,Arable land (% of land area),18.0138920008963,,,1,Arable land (% of land area),
48
+ MA,Morocco,2009,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.5679374454214,,,1,Agricultural irrigated land (% of total agricultural land),
49
+ MA,Morocco,2009,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1919.4,,,0,Cereal yield (kg per hectare),
50
+ MA,Morocco,2009,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),11.103,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
51
+ MA,Morocco,2009,SP.POP.GROW,Population growth (annual %),1.33260098178586,,,1,Population growth (annual %),
52
+ MA,Morocco,2010,AG.LND.ARBL.ZS,Arable land (% of land area),17.3186197624916,,,1,Arable land (% of land area),
53
+ MA,Morocco,2010,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.54810709510042,,,1,Agricultural irrigated land (% of total agricultural land),
54
+ MA,Morocco,2010,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1547.5,,,0,Cereal yield (kg per hectare),
55
+ MA,Morocco,2010,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
56
+ MA,Morocco,2010,SP.POP.GROW,Population growth (annual %),1.35274286216317,,,1,Population growth (annual %),
57
+ MA,Morocco,2011,AG.LND.ARBL.ZS,Arable land (% of land area),17.4855478377773,,,1,Arable land (% of land area),
58
+ MA,Morocco,2011,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.6057308379673,,,1,Agricultural irrigated land (% of total agricultural land),
59
+ MA,Morocco,2011,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1614.4,,,0,Cereal yield (kg per hectare),
60
+ MA,Morocco,2011,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
61
+ MA,Morocco,2011,SP.POP.GROW,Population growth (annual %),1.36305168989377,,,1,Population growth (annual %),
62
+ MA,Morocco,2012,AG.LND.ARBL.ZS,Arable land (% of land area),18.0304727761595,,,1,Arable land (% of land area),
63
+ MA,Morocco,2012,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.74841298556064,,,1,Agricultural irrigated land (% of total agricultural land),
64
+ MA,Morocco,2012,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1016.6,,,0,Cereal yield (kg per hectare),
65
+ MA,Morocco,2012,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
66
+ MA,Morocco,2012,SP.POP.GROW,Population growth (annual %),1.3359712863904,,,1,Population growth (annual %),
67
+ MA,Morocco,2013,AG.LND.ARBL.ZS,Arable land (% of land area),17.5309209052207,,,1,Arable land (% of land area),
68
+ MA,Morocco,2013,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),4.95630105296877,,,1,Agricultural irrigated land (% of total agricultural land),
69
+ MA,Morocco,2013,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1828.3,,,0,Cereal yield (kg per hectare),
70
+ MA,Morocco,2013,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
71
+ MA,Morocco,2013,SP.POP.GROW,Population growth (annual %),1.28781015302784,,,1,Population growth (annual %),
72
+ MA,Morocco,2014,AG.LND.ARBL.ZS,Arable land (% of land area),17.0313690342819,,,1,Arable land (% of land area),
73
+ MA,Morocco,2014,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),5.17902434970498,,,1,Agricultural irrigated land (% of total agricultural land),
74
+ MA,Morocco,2014,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1454.3,,,0,Cereal yield (kg per hectare),
75
+ MA,Morocco,2014,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
76
+ MA,Morocco,2014,SP.POP.GROW,Population growth (annual %),1.22723874148544,,,1,Population growth (annual %),
77
+ MA,Morocco,2015,AG.LND.ARBL.ZS,Arable land (% of land area),16.7987900515348,,,1,Arable land (% of land area),
78
+ MA,Morocco,2015,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),5.37537857356808,,,1,Agricultural irrigated land (% of total agricultural land),
79
+ MA,Morocco,2015,AG.YLD.CREL.KG,Cereal yield (kg per hectare),2140.7,,,0,Cereal yield (kg per hectare),
80
+ MA,Morocco,2015,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
81
+ MA,Morocco,2015,SP.POP.GROW,Population growth (annual %),1.17075639938741,,,1,Population growth (annual %),
82
+ MA,Morocco,2016,AG.LND.ARBL.ZS,Arable land (% of land area),18.4203450593771,,,1,Arable land (% of land area),
83
+ MA,Morocco,2016,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),5.41635627530364,,,1,Agricultural irrigated land (% of total agricultural land),
84
+ MA,Morocco,2016,AG.YLD.CREL.KG,Cereal yield (kg per hectare),936,,,0,Cereal yield (kg per hectare),
85
+ MA,Morocco,2016,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
86
+ MA,Morocco,2016,SP.POP.GROW,Population growth (annual %),1.19450726277516,,,1,Population growth (annual %),
87
+ MA,Morocco,2017,AG.LND.ARBL.ZS,Arable land (% of land area),18.8634532825454,,,1,Arable land (% of land area),
88
+ MA,Morocco,2017,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),5.70916897368629,,,1,Agricultural irrigated land (% of total agricultural land),
89
+ MA,Morocco,2017,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1757.4,,,0,Cereal yield (kg per hectare),
90
+ MA,Morocco,2017,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
91
+ MA,Morocco,2017,SP.POP.GROW,Population growth (annual %),1.20034336418867,,,1,Population growth (annual %),
92
+ MA,Morocco,2018,AG.LND.ARBL.ZS,Arable land (% of land area),17.5939305399955,,,1,Arable land (% of land area),
93
+ MA,Morocco,2018,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),5.58609255577493,,,1,Agricultural irrigated land (% of total agricultural land),
94
+ MA,Morocco,2018,AG.YLD.CREL.KG,Cereal yield (kg per hectare),2263.2,,,0,Cereal yield (kg per hectare),
95
+ MA,Morocco,2018,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
96
+ MA,Morocco,2018,SP.POP.GROW,Population growth (annual %),1.1036421008163,,,1,Population growth (annual %),
97
+ MA,Morocco,2019,AG.LND.ARBL.ZS,Arable land (% of land area),15.4581313018149,,,1,Arable land (% of land area),
98
+ MA,Morocco,2019,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),5.958751056585,,,1,Agricultural irrigated land (% of total agricultural land),
99
+ MA,Morocco,2019,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1453.6,,,0,Cereal yield (kg per hectare),
100
+ MA,Morocco,2019,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
101
+ MA,Morocco,2019,SP.POP.GROW,Population growth (annual %),1.03022315933698,,,1,Population growth (annual %),
102
+ MA,Morocco,2020,AG.LND.ARBL.ZS,Arable land (% of land area),15.68695944432,,,1,Arable land (% of land area),
103
+ MA,Morocco,2020,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
104
+ MA,Morocco,2020,AG.YLD.CREL.KG,Cereal yield (kg per hectare),747.4,,,0,Cereal yield (kg per hectare),
105
+ MA,Morocco,2020,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
106
+ MA,Morocco,2020,SP.POP.GROW,Population growth (annual %),1.02565486360782,,,1,Population growth (annual %),
107
+ MA,Morocco,2021,AG.LND.ARBL.ZS,Arable land (% of land area),15.7640600492942,,,1,Arable land (% of land area),
108
+ MA,Morocco,2021,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
109
+ MA,Morocco,2021,AG.YLD.CREL.KG,Cereal yield (kg per hectare),2328.7,,,0,Cereal yield (kg per hectare),
110
+ MA,Morocco,2021,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
111
+ MA,Morocco,2021,SP.POP.GROW,Population growth (annual %),1.00691847923959,,,1,Population growth (annual %),
112
+ MA,Morocco,2022,AG.LND.ARBL.ZS,Arable land (% of land area),15.9299563074165,,,1,Arable land (% of land area),
113
+ MA,Morocco,2022,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
114
+ MA,Morocco,2022,AG.YLD.CREL.KG,Cereal yield (kg per hectare),943.3,,,0,Cereal yield (kg per hectare),
115
+ MA,Morocco,2022,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),10.573,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
116
+ MA,Morocco,2022,SP.POP.GROW,Population growth (annual %),1.00863622672701,,,1,Population growth (annual %),
117
+ MA,Morocco,2023,AG.LND.ARBL.ZS,Arable land (% of land area),16.0508709388304,,,1,Arable land (% of land area),
118
+ MA,Morocco,2023,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
119
+ MA,Morocco,2023,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1482.1,,,0,Cereal yield (kg per hectare),
120
+ MA,Morocco,2023,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
121
+ MA,Morocco,2023,SP.POP.GROW,Population growth (annual %),1.02195181223548,,,1,Population growth (annual %),
122
+ MA,Morocco,2024,AG.LND.ARBL.ZS,Arable land (% of land area),15.836029576518,,,1,Arable land (% of land area),
123
+ MA,Morocco,2024,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
124
+ MA,Morocco,2024,AG.YLD.CREL.KG,Cereal yield (kg per hectare),1240.1,,,0,Cereal yield (kg per hectare),
125
+ MA,Morocco,2024,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
126
+ MA,Morocco,2024,SP.POP.GROW,Population growth (annual %),0.972827595296714,,,1,Population growth (annual %),
127
+ MA,Morocco,2025,AG.LND.ARBL.ZS,Arable land (% of land area),,,,1,Arable land (% of land area),
128
+ MA,Morocco,2025,AG.LND.IRIG.AG.ZS,Agricultural land irrigated (%),,,,1,Agricultural irrigated land (% of total agricultural land),
129
+ MA,Morocco,2025,AG.YLD.CREL.KG,Cereal yield (kg per hectare),,,,0,Cereal yield (kg per hectare),
130
+ MA,Morocco,2025,ER.H2O.FWTL.K3,Annual freshwater withdrawals (billion cubic meters),,,,1,"Annual freshwater withdrawals, total (billion cubic meters)",
131
+ MA,Morocco,2025,SP.POP.GROW,Population growth (annual %),0.913842778572571,,,1,Population growth (annual %),
mws_lab/fetch.py ADDED
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Download Morocco World Bank indicator observations for 2000–2025.
4
+ Output:
5
+ data/worldbank_data.csv
6
+ Run: python fetch_worldbank_data.py
7
+ Dependency: requests (pip install requests)
8
+ """
9
+ import csv
10
+ import time
11
+ from pathlib import Path
12
+ import requests
13
+
14
+ START_YEAR, END_YEAR = 2000, 2025
15
+ COUNTRY = "MA"
16
+ OUTPUT = Path("data/worldbank_data.csv")
17
+
18
+ INDICATORS = {
19
+ "ER.H2O.FWTL.K3": "Annual freshwater withdrawals (billion cubic meters)",
20
+ "AG.LND.IRIG.AG.ZS": "Agricultural land irrigated (%)",
21
+ "SP.POP.GROW": "Population growth (annual %)",
22
+ "AG.YLD.CREL.KG": "Cereal yield (kg per hectare)",
23
+ "AG.LND.ARBL.ZS": "Arable land (% of land area)",
24
+ }
25
+
26
+ BASE_URL = "https://api.worldbank.org/v2/country/{country}/indicator/{indicator}"
27
+ FIELDS = [
28
+ "country_code", "country_name", "year", "indicator_code",
29
+ "indicator_name", "value", "unit", "obs_status", "decimal",
30
+ "source_note", "source_organization",
31
+ ]
32
+
33
+ def fetch_indicator(session, code, name):
34
+ url = BASE_URL.format(country=COUNTRY, indicator=code)
35
+ params = {
36
+ "date": f"{START_YEAR}:{END_YEAR}",
37
+ "format": "json",
38
+ "per_page": 100,
39
+ "page": 1,
40
+ }
41
+ rows = []
42
+ while True:
43
+ response = session.get(url, params=params, timeout=60)
44
+ response.raise_for_status()
45
+ payload = response.json()
46
+ if not isinstance(payload, list) or len(payload) < 2:
47
+ raise RuntimeError(f"Unexpected API response for {code}: {payload!r}")
48
+ page_meta, observations = payload[0], payload[1] or []
49
+ for obs in observations:
50
+ rows.append({
51
+ "country_code": COUNTRY,
52
+ "country_name": (obs.get("country") or {}).get("value"),
53
+ "year": int(obs["date"]),
54
+ "indicator_code": code,
55
+ "indicator_name": name,
56
+ "value": obs.get("value"),
57
+ "unit": obs.get("unit"),
58
+ "obs_status": obs.get("obs_status"),
59
+ "decimal": obs.get("decimal"),
60
+ "source_note": (obs.get("indicator") or {}).get("value"),
61
+ "source_organization": None,
62
+ })
63
+ if params["page"] >= int(page_meta.get("pages", 1)):
64
+ break
65
+ params["page"] += 1
66
+ return rows
67
+
68
+ def main():
69
+ session = requests.Session()
70
+ session.headers.update({"User-Agent": "Morocco-Water-Scarcity-Research/1.0"})
71
+ all_rows = []
72
+ for code, name in INDICATORS.items():
73
+ rows = fetch_indicator(session, code, name)
74
+ print(f"{code}: {len(rows)} annual observations returned")
75
+ all_rows.extend(rows)
76
+ time.sleep(0.15)
77
+
78
+ all_rows.sort(key=lambda r: (r["year"], r["indicator_code"]))
79
+ OUTPUT.parent.mkdir(parents=True, exist_ok=True)
80
+ with OUTPUT.open("w", newline="", encoding="utf-8-sig") as f:
81
+ writer = csv.DictWriter(f, fieldnames=FIELDS)
82
+ writer.writeheader()
83
+ writer.writerows(all_rows)
84
+
85
+ print(f"\nSaved: {OUTPUT.resolve()}")
86
+ print(f"Rows: {len(all_rows)}")
87
+ print(f"Year range requested: {START_YEAR}–{END_YEAR}")
88
+ print("Note: World Bank missing observations are retained as blank values; they are not interpolated.")
89
+ print("Use only complete observations for each analysis and report the effective sample size.")
90
+
91
+ if __name__ == "__main__":
92
+ main()
@@ -0,0 +1,529 @@
1
+ Metadata-Version: 2.4
2
+ Name: mws-lab
3
+ Version: 1.0.0
4
+ Summary: Water Scarcity in Morocco: A Multivariate Analysis of Climatic, Agricultural, and Socioeconomic Drivers
5
+ Author: Samir Baladi
6
+ Author-email: Samir Baladi <gitdeeper@gmail.com>
7
+ Maintainer-email: Samir Baladi <gitdeeper@gmail.com>
8
+ License: MIT
9
+ Project-URL: Manuscript, https://doi.org/10.5281/zenodo.23884236
10
+ Project-URL: Website, https://mws-lab.netlify.app
11
+ Project-URL: PyPI, https://pypi.org/project/mws-lab/
12
+ Project-URL: Figshare, https://doi.org/10.6084/m9.figshare.34884417
13
+ Project-URL: Zenodo, https://doi.org/10.5281/zenodo.23884236
14
+ Project-URL: ORCID, https://orcid.org/0009-0003-8903-0029
15
+ Keywords: water scarcity,morocco,world bank indicators,OLS regression,environmental science,water policy
16
+ Classifier: Development Status :: 4 - Beta
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Scientific/Engineering
25
+ Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
26
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: pandas>=1.5.0
31
+ Requires-Dist: numpy>=1.23.0
32
+ Requires-Dist: scipy>=1.9.0
33
+ Requires-Dist: statsmodels>=0.13.0
34
+ Requires-Dist: matplotlib>=3.6.0
35
+ Requires-Dist: seaborn>=0.12.0
36
+ Requires-Dist: requests>=2.28.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
40
+ Requires-Dist: black>=23.0.0; extra == "dev"
41
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
42
+ Requires-Dist: isort>=5.12.0; extra == "dev"
43
+ Requires-Dist: build>=1.0.0; extra == "dev"
44
+ Requires-Dist: twine>=4.0.0; extra == "dev"
45
+ Dynamic: author
46
+ Dynamic: license-file
47
+ Dynamic: requires-python
48
+
49
+ <div align="center">
50
+
51
+ # Water Scarcity in Morocco
52
+
53
+ ### A Multivariate Analysis of Climatic, Agricultural, and Socioeconomic Drivers
54
+
55
+ *Exploratory Associational Analysis · World Bank Indicators 2000–2025 · OLS Diagnostics · Policy Implications*
56
+
57
+ ---
58
+
59
+ [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.23884236-1B4F72?logo=zenodo&logoColor=white)](https://doi.org/10.5281/zenodo.23884236)
60
+ [![PyPI](https://img.shields.io/badge/PyPI-mws--lab-3775A9?logo=pypi&logoColor=white)](https://pypi.org/project/mws-lab/)
61
+ [![Figshare](https://img.shields.io/badge/Figshare-10.6084%2Fm9.figshare.34884417-FC4B00?logo=figshare&logoColor=white)](https://doi.org/10.6084/m9.figshare.34884417)
62
+ [![Website](https://img.shields.io/badge/website-mws--lab.netlify.app-00C7B7?logo=netlify&logoColor=white)](https://mws-lab.netlify.app)
63
+ [![ORCID](https://img.shields.io/badge/ORCID-0009--0003--8903--0029-A6CE39?logo=orcid&logoColor=white)](https://orcid.org/0009-0003-8903-0029)
64
+ [![Domain](https://img.shields.io/badge/domain-Earth%20%26%20Environmental%20Sciences-2e8b57)]()
65
+ [![Data](https://img.shields.io/badge/data-World%20Bank%20WDI-1B4F72)](https://data.worldbank.org/country/morocco)
66
+ [![Python](https://img.shields.io/badge/analysis-Python-3776ab?logo=python&logoColor=white)](https://python.org)
67
+ [![Status](https://img.shields.io/badge/status-exploratory--associational-blue)]()
68
+ [![Causal](https://img.shields.io/badge/causal%20claims-none-orange)]()
69
+ [![License: MIT](https://img.shields.io/badge/license-MIT-27ae60)](LICENSE)
70
+
71
+ ---
72
+
73
+ **`5 WDI Indicators`** · **`2000–2025 Panel`** · **`n = 16 Model Sample`** · **`R² = 0.812`** · **`κ ≈ 78,500`** · **`88% Agricultural Share`**
74
+
75
+ ---
76
+
77
+ [Research Paper](PUBLICATION/water_scarcity_morocco.pdf) · [Key Findings](#-key-findings) · [Methodology](#-methodology) · [Results](#-results) · [Limitations](#-limitations) · [Policy Implications](#-policy-implications) · [Citation](#-citation)
78
+
79
+ </div>
80
+
81
+ ---
82
+
83
+ ## 📌 Overview
84
+
85
+ Morocco's renewable freshwater per capita fell from roughly **2,560 m³ per year in 1960** to about **620 m³ in 2020**, well inside the United Nations' absolute water-scarcity threshold. Internal renewable water resources stood at **777 m³ per capita in 2022**, and the national water-stress index reached **50.75%** that year.
86
+
87
+ This study asks how three classes of drivers (climatic, agricultural, and socioeconomic) relate to the trajectory of **national freshwater withdrawals** between 2000 and 2025. It uses five publicly available World Bank indicators, supplemented by national indicators from Morocco's 2025 State of the Environment Report.
88
+
89
+ > The analysis is **exploratory and associational**. It is not designed to establish causal attribution, and its conclusions should be read as **hypothesis-generating rather than confirmatory**.
90
+
91
+ ### Research Question
92
+
93
+ What are the relative contributions of agricultural land-use change, agricultural productivity, and population growth to the observed pattern of freshwater withdrawals in Morocco, and what do the strength and structure of these associations imply for water policy?
94
+
95
+ ---
96
+
97
+ ## 🗂️ Table of Contents
98
+
99
+ - [Overview](#-overview)
100
+ - [Key Findings](#-key-findings)
101
+ - [Conceptual Framework](#-conceptual-framework)
102
+ - [Data Sources](#-data-sources)
103
+ - [Methodology](#-methodology)
104
+ - [Results](#-results)
105
+ - [Discussion Highlights](#-discussion-highlights)
106
+ - [Policy Implications](#-policy-implications)
107
+ - [Limitations](#-limitations)
108
+ - [Future Research](#-future-research)
109
+ - [Repository Structure](#-repository-structure)
110
+ - [Reproducing the Analysis](#-reproducing-the-analysis)
111
+ - [Research Paper](#-research-paper)
112
+ - [Platforms](#-platforms)
113
+ - [Citation](#-citation)
114
+ - [Key References](#-key-references)
115
+ - [License](#-license)
116
+ - [Author](#-author)
117
+
118
+ ---
119
+
120
+ ## 🔑 Key Findings
121
+
122
+ | # | Finding |
123
+ |---|---------|
124
+ | 1 | Per-capita renewable water fell by roughly three-quarters between 1960 and 2020 (≈2,560 → ≈620 m³/yr). |
125
+ | 2 | Agriculture absorbs about **88%** of total water allocation, against 11% for drinking water and 1% for industry and tourism. |
126
+ | 3 | National freshwater withdrawals fell from **12.60** to **10.573 billion m³** (2000 → 2010) and were reported at that level through 2022, even as cereal yield rose from 366.8 to 1,240.1 kg/ha. |
127
+ | 4 | An exploratory OLS model (2004–2019, n = 16) reaches **R² = 0.812** (adjusted 0.744), but the design matrix condition number of about **78,500** signals severe multicollinearity. |
128
+ | 5 | Irrigated land and population growth are strongly inversely correlated (**r = −0.89**), so their effects cannot be separated in this dataset. |
129
+ | 6 | The 2025–2026 rainfall and dam-filling rebound is a short-term storage buffer, **not** a reversal of the long-run per-capita decline. |
130
+
131
+ ---
132
+
133
+ ## 🧭 Conceptual Framework
134
+
135
+ ```
136
+ CLIMATE DRIVERS ──→ HYDROLOGICAL SYSTEM ──→ WATER AVAILABILITY
137
+ Rainfall Runoff Renewable supply
138
+ Temperature Reservoirs Per-capita water
139
+ Drought Aquifers │
140
+ │ │
141
+ ↓ ↓
142
+ SOCIOECONOMIC PRESSURES SECTORAL DEMAND
143
+ Population · Urban demand Agriculture · Drinking
144
+ water · Industry
145
+ │ │
146
+ └───────────┬───────────┘
147
+ ↓
148
+ WATER SECURITY OUTCOMES
149
+ Scarcity · Allocation · Resilience
150
+ ```
151
+
152
+ The framework is adapted from the structural relationships described in the reviewed literature. Climate variables enter the discussion qualitatively; they are **not** regressors in the model.
153
+
154
+ ---
155
+
156
+ ## 📥 Data Sources
157
+
158
+ ### 1. World Bank World Development Indicators (annual, Morocco, 2000–2025)
159
+
160
+ | Variable | Indicator Code | Notes |
161
+ |----------|----------------|-------|
162
+ | Arable land (% of land area) | `AG.LND.ARBL.ZS` | 19.64% (2000) → 15.84% (2024) |
163
+ | Agricultural land irrigated (% of agricultural land) | `AG.LND.IRIG.AG.ZS` | Reported from 2004; 4.30% (2004) → 5.96% (2019) |
164
+ | Cereal yield (kg per hectare) | `AG.YLD.CREL.KG` | 366.8 (2000) → 1,240.1 (2024) |
165
+ | Annual freshwater withdrawals (billion m³) | `ER.H2O.FWTL.K3` | Reported through 2022 |
166
+ | Population growth (annual %) | `SP.POP.GROW` | 1.40% (2000) → 0.91% (2025) |
167
+
168
+ ### 2. Morocco State of the Environment Report 2025
169
+
170
+ Renewable water resources per capita, potential and mobilizable water resources, groundwater abstraction, sectoral water allocation, seasonal rainfall, and national dam-filling rates for 2025 and 2026.
171
+
172
+ The two sources are kept analytically distinct. The World Bank panel supports the multivariate analysis; the national indicators support the descriptive water-balance and recovery discussion. **No missing values were imputed or interpolated.**
173
+
174
+ ---
175
+
176
+ ## 🔬 Methodology
177
+
178
+ ### Analytical Workflow
179
+
180
+ ```
181
+ ┌────────────────────────────────────────────────────────────┐
182
+ │ 1. Data Acquisition → Government reports · World Bank│
183
+ │ 2. Data Harmonization → Units · periods · metadata │
184
+ │ 3. Quality Control → Missingness · outliers · source│
185
+ │ 4. Exploratory Analysis → Descriptives · trends │
186
+ │ 5. Empirical Modelling → Correlation · OLS (validated) │
187
+ │ 6. Robustness Checks → Diagnostics · specifications │
188
+ │ 7. Interpretation → Policy implications · limits │
189
+ └────────────────────────────────────────────────────────────┘
190
+ ```
191
+
192
+ ### Regression Specification
193
+
194
+ ```
195
+ FW_t = β0 + β1·IRRIG_t + β2·POPGR_t + β3·YIELD_t + β4·ARABLE_t + ε_t
196
+
197
+ β̂ = (XᵀX)⁻¹ Xᵀy
198
+ ```
199
+
200
+ | Symbol | Variable |
201
+ |--------|----------|
202
+ | `FW` | Annual freshwater withdrawals |
203
+ | `IRRIG` | Irrigated share of agricultural land |
204
+ | `POPGR` | Population growth rate |
205
+ | `YIELD` | Cereal yield |
206
+ | `ARABLE` | Arable land share |
207
+
208
+ Because irrigated land is reported only from 2004 and withdrawals only through 2022, the **complete-case sample is 2004–2019 (n = 16)**.
209
+
210
+ ### Metrics and Diagnostics
211
+
212
+ | Purpose | Measure |
213
+ |---------|---------|
214
+ | Model fit | R², adjusted R² = 1 − (1 − R²)(n − 1)/(n − k − 1) |
215
+ | Predictive error | RMSE, MAE, MAPE |
216
+ | Bivariate association | Pearson r on pairwise-complete observations |
217
+ | Coefficient uncertainty | Standard error, t-statistic, 95% confidence interval |
218
+ | Multicollinearity | VIF_j = 1/(1 − R²_j), condition number κ(X) = σ_max/σ_min |
219
+
220
+ A condition number above about 30 is conventionally taken to indicate moderate-to-severe multicollinearity.
221
+
222
+ ### Supplementary Indicators
223
+
224
+ ```
225
+ PCW_t = RWR_t / POP_t (per-capita renewable water)
226
+ WSI_t = (Total withdrawals_t / RWR_t) × 100% (water-stress index)
227
+ DFR_t = (Stored reservoir volume_t / Total reservoir capacity) × 100% (dam-filling rate)
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 📊 Results
233
+
234
+ ### National Water Balance (State of the Environment Report 2025)
235
+
236
+ | Indicator | Value |
237
+ |-----------|-------|
238
+ | Renewable water per capita (2025) | ≈ 600 m³/person/year |
239
+ | Potential natural water resources | ≈ 22 billion m³/year |
240
+ | Technically mobilizable resources | ≈ 8 billion m³/year |
241
+ | Groundwater abstraction | ≈ 5 billion m³/year |
242
+ | Water-stress index (2022) | 50.75% |
243
+
244
+ Only a minority of the nominal resource base is operationally accessible.
245
+
246
+ ### Sectoral Allocation
247
+
248
+ | Sector | Share |
249
+ |--------|-------|
250
+ | Agriculture | ≈ 88% |
251
+ | Drinking water | ≈ 11% |
252
+ | Industry and tourism | ≈ 1% |
253
+
254
+ This is consistent with the historical 75–87% range reported for irrigation's share of national withdrawals.
255
+
256
+ ### Rainfall and Dam-Filling Recovery
257
+
258
+ | Observation | Value |
259
+ |-------------|-------|
260
+ | Average seasonal rainfall, 2015–2020 | 307.9 mm |
261
+ | Season 2024–2025 | 293 mm |
262
+ | Season 2025–2026 | 462 mm |
263
+ | National dam-filling rate, 31 Oct 2025 | 31.29% |
264
+ | National dam-filling rate, 31 Oct 2026 | 65.81% |
265
+
266
+ The observations do not form a continuous annual series and are plotted on separate axes.
267
+
268
+ ### Pairwise Correlations (pairwise-complete)
269
+
270
+ | Pair | r | n |
271
+ |------|---|---|
272
+ | Withdrawals ↔ Irrigated land | −0.70 | 16 |
273
+ | Withdrawals ↔ Cereal yield | −0.36 | 23 |
274
+ | Withdrawals ↔ Population growth | 0.49 | 23 |
275
+ | Withdrawals ↔ Arable land | 0.67 | 23 |
276
+ | **Irrigated land ↔ Population growth** | **−0.89** | 16 |
277
+ | Population growth ↔ Arable land | 0.78 | 25 |
278
+ | Irrigated land ↔ Arable land | −0.44 | 16 |
279
+
280
+ ### Exploratory OLS Model (2004–2019, n = 16)
281
+
282
+ | Statistic | Value |
283
+ |-----------|-------|
284
+ | R² | 0.812 |
285
+ | Adjusted R² | 0.744 |
286
+ | Condition number κ(X) | ≈ 78,500 |
287
+
288
+ | Predictor | Approximate coefficient | Reading |
289
+ |-----------|-------------------------|---------|
290
+ | Irrigated land | ≈ −3 | Negative, relatively tightly estimated; 95% CI excludes zero |
291
+ | Population growth | ≈ −14 | Largest magnitude, wide interval; strongly collinear with irrigated land |
292
+ | Cereal yield | ≈ 0 | Close to zero, narrow interval |
293
+ | Arable land | small positive | Interval close to, but not clearly excluding, zero |
294
+
295
+ With a condition number in the tens of thousands, individual coefficient magnitudes and signs are unstable and **must not be read as independent causal effects**. The model is reported as a description of joint explanatory power only.
296
+
297
+ ---
298
+
299
+ ## 💬 Discussion Highlights
300
+
301
+ - **Total withdrawals versus per-capita scarcity.** Population growth drives long-run per-capita scarcity through the denominator of the per-capita ratio, while agricultural demand is the proximate lever on total withdrawals. A policy that stabilizes withdrawals while population grows will still see per-capita water security erode.
302
+ - **Multicollinearity as a finding.** Irrigation expansion, cereal productivity growth, and demographic deceleration moved together as a largely non-separable complex. Separating them needs longer series, basin-level panels, or quasi-experimental variation.
303
+ - **Interpretive risk of a wet year.** A single favorable season can overshadow a multi-decade structural decline. Reservoir storage is a short-horizon buffer; per-capita availability is a slow-moving structural indicator.
304
+ - **Efficiency signal.** Withdrawals were broadly stable to declining after 2010 while cereal yield rose substantially, which is consistent with efficiency gains and adaptive farmer behavior reported in the literature.
305
+
306
+ ---
307
+
308
+ ## 🧩 Policy Implications
309
+
310
+ 1. **Irrigation efficiency.** Because agriculture accounts for about 88% of allocation, drip and precision irrigation, crop-water-productivity-oriented extension services, and support for less water-intensive crop portfolios in the most stressed basins are the largest single lever.
311
+ 2. **Per-capita and per-basin monitoring.** Water-security planning should be expressed in per-capita and per-basin terms, not only in aggregate withdrawals or dam storage, to avoid over-reading favorable rainfall years.
312
+ 3. **Better data.** Basin-level and sub-annual data on groundwater abstraction, aquifer depletion, and disaggregated sectoral consumption would allow agricultural, climatic, and demographic effects to be separated with greater statistical independence.
313
+
314
+ ---
315
+
316
+ ## ⚠️ Limitations
317
+
318
+ | Type | Concern |
319
+ |------|---------|
320
+ | Sample size | Only n = 16 for the multivariate model, limited by the irrigated-land series |
321
+ | Multicollinearity | κ(X) ≈ 78,500; coefficients are unstable and not independently interpretable |
322
+ | Missing climate variables | No rainfall, temperature, or evapotranspiration in the regression; climate is discussed qualitatively |
323
+ | Aggregation | National indicators mask heterogeneity across river basins |
324
+ | Inference | All relationships are associational; no hypothesis test is treated as confirmatory |
325
+ | Indicator coverage | Withdrawals are reported only through 2022; some series are partially incomplete |
326
+
327
+ ---
328
+
329
+ ## 🔭 Future Research
330
+
331
+ | Direction | Focus |
332
+ |-----------|-------|
333
+ | Basin-level panels | Disaggregate by river basin to capture aridity, irrigation intensity, groundwater depletion |
334
+ | Direct climate variables | Add rainfall, temperature, and evapotranspiration to the model |
335
+ | Causal identification | Quasi-experimental or instrumental-variable methods (for example staggered irrigation scheme rollouts) |
336
+ | Infrastructure effects | Reservoir sedimentation and effective storage capacity |
337
+ | Behavioral and technological mediation | Irrigation technology adoption and farmer adaptation |
338
+
339
+ ---
340
+
341
+ ## 📁 Repository Structure
342
+
343
+
344
+ ```
345
+ mws-lab/
346
+ ├── README.md
347
+ ├── AUTHORS.md
348
+ ├── CHANGELOG.md
349
+ ├── CITATION.cff
350
+ ├── CONTRIBUTING.md
351
+ ├── LICENSE
352
+ ├── MANIFEST.in
353
+ ├── VERSION
354
+ ├── pyproject.toml
355
+ ├── requirements.txt
356
+ ├── setup.py
357
+ ├── setup.cfg
358
+ ├── upload_morocco.py
359
+ │
360
+ ├── morocco_water_scarcity/ # Python package (pending build)
361
+ │ ├── __init__.py
362
+ │ ├── fetch.py
363
+ │ └── data/
364
+ │ ├── worldbank_data.csv
365
+ │ └── input.json
366
+ │
367
+ ├── DATA/
368
+ │ └── raw/
369
+ │ ├── fetch_worldbank_data.py
370
+ │ ├── worldbank_data.csv
371
+ │ └── input.json
372
+ │
373
+ ├── ANALYSIS/
374
+ │ ├── ANALYSIS_REPORT.md
375
+ │ └── analysis_insights.json
376
+ │
377
+ ├── PUBLICATION/
378
+ │ ├── water_scarcity_morocco.pdf # Manuscript
379
+ │ ├── figures/ # 7 figures
380
+ │ ├── Netlify/ # Website source
381
+ │ ├── dist/ # (to be rebuilt)
382
+ │ ├── credit_table.md
383
+ │ ├── manifest.json
384
+ │ └── netlify.toml
385
+ │
386
+ ├── REPORTS/ # Governance and audit
387
+ ├── EXTERNAL_REVIEW/
388
+ ├── VALIDATION/
389
+ └── docs/
390
+ ├── ITERATION_LOG.md
391
+ └── comprehensive_audit_report.json
392
+ ```
393
+
394
+ ---
395
+
396
+ ## ♻️ Reproducing the Analysis
397
+
398
+ The paper reports that all computation was performed in **Python** with standard numerical and statistical libraries. To reproduce it:
399
+
400
+ 1. Download the five World Bank indicators listed in [Data Sources](#-data-sources) for Morocco, 2000–2025.
401
+ 2. Keep missing values missing; do not impute or interpolate.
402
+ 3. Compute Pearson correlations on pairwise-complete observations and record n for each pair.
403
+ 4. Restrict the regression to the complete-case window **2004–2019 (n = 16)**.
404
+ 5. Estimate Equation 1 by OLS and report R², adjusted R², RMSE, MAE, MAPE, coefficient standard errors, 95% CIs, VIFs, and the design-matrix condition number.
405
+ 6. Treat every result as associational.
406
+
407
+ ---
408
+
409
+ ## 📄 Research Paper
410
+
411
+ **Title:** Water Scarcity in Morocco: A Multivariate Analysis of Climatic, Agricultural, and Socioeconomic Drivers
412
+
413
+ **Status:** Initial Research Manuscript — Exploratory Multivariate Analysis
414
+ **Domain:** Earth and Environmental Sciences — Environmental Management, Policy and Planning
415
+ **Version:** 1.0 · November 2026
416
+ **DOI:** [10.5281/zenodo.23884236](https://doi.org/10.5281/zenodo.23884236)
417
+
418
+ See [`PUBLICATION/water_scarcity_morocco.pdf`](PUBLICATION/water_scarcity_morocco.pdf) for the full manuscript.
419
+
420
+ **Keywords:** Water scarcity · Morocco · Water stress · Irrigation · Freshwater withdrawals · Climate variability · Agricultural water demand · Population growth · Multivariate analysis · Water policy
421
+
422
+ ---
423
+
424
+ ## 🌐 Platforms
425
+
426
+ | Platform | URL | Role |
427
+ |----------|-----|------|
428
+ | Zenodo | [doi.org/10.5281/zenodo.23884236](https://doi.org/10.5281/zenodo.23884236) | Citable DOI, manuscript archive |
429
+ | ORCID | [orcid.org/0009-0003-8903-0029](https://orcid.org/0009-0003-8903-0029) | Researcher identity |
430
+ | World Bank Data | [data.worldbank.org/country/morocco](https://data.worldbank.org/country/morocco) | Source of the five WDI indicators |
431
+
432
+ ---
433
+
434
+ ## 📖 Citation
435
+
436
+ If this work contributes to your research, please cite it as follows.
437
+
438
+ ### BibTeX
439
+
440
+ ```bibtex
441
+ @article{baladi2026waterscarcity,
442
+ author = {Baladi, Samir},
443
+ title = {Water Scarcity in {Morocco}: A Multivariate Analysis of
444
+ Climatic, Agricultural, and Socioeconomic Drivers},
445
+ year = {2026},
446
+ month = nov,
447
+ version = {1.0},
448
+ publisher = {Zenodo},
449
+ doi = {10.5281/zenodo.23884236},
450
+ url = {https://doi.org/10.5281/zenodo.23884236},
451
+ note = {Ronin Institute / Rite of Renaissance. Exploratory associational analysis}
452
+ }
453
+ ```
454
+
455
+ ### APA
456
+
457
+ > Baladi, S. (2026). *Water scarcity in Morocco: A multivariate analysis of climatic, agricultural, and socioeconomic drivers* (Version 1.0). Zenodo. https://doi.org/10.5281/zenodo.23884236
458
+
459
+ ---
460
+
461
+ ## 📚 Key References
462
+
463
+ 1. Boudhar, S., & Boudhar, A. (2025). Water scarcity and the agricultural trade structure in Morocco: A quantification of virtual water flows in Morocco's foreign trade of agricultural products. https://doi.org/10.21203/rs.3.rs-6080363/v1
464
+ 2. Sana, A., Chfadi, T., & El Mansoum, R. (2026). From belief to behavior: An exploratory analysis of adaptive behavior to water scarcity, irrigation technology choice, and water productivity in Morocco. *Agricultural Water Management*. https://doi.org/10.1016/j.agwat.2026.110453
465
+ 3. World Bank. (2017). *Managing urban water scarcity in Morocco*. https://doi.org/10.1596/29190
466
+ 4. Bajja, S., Sackitey, G. M., & Hassanein, E. A. (2026). Determinants of agricultural productivity in Morocco: An empirical analysis of climatic, technological, and socioeconomic factors. *Environmental and Sustainability Indicators*. https://doi.org/10.1016/j.indic.2026.101369
467
+ 5. Taheripour, F., Tyner, W. E., & Haqiqi, I. (2020). *Water scarcity in Morocco*. https://doi.org/10.1596/33306
468
+ 6. Tekken, V., & Kropp, J. (2012). Climate-driven or human-induced: Indicating severe water scarcity in the Moulouya River basin (Morocco). *Water, 4*(4), 959–982. https://doi.org/10.3390/w4040959
469
+ 7. Rijsberman, F. R. (2006). Water scarcity: Fact or fiction? *Agricultural Water Management, 80*(1–3), 5–22. https://doi.org/10.1016/j.agwat.2005.07.001
470
+ 8. Sanad, H., Moussadek, R., & Dakak, H. (2024). Ecological and health risk assessment of heavy metals in groundwater within an agricultural ecosystem using GIS and multivariate statistical analysis (MSA): A case study of the Mnasra region, Gharb plain, Morocco. *Water, 16*(17), 2417. https://doi.org/10.3390/w16172417
471
+ 9. Loudyi, D., Saghiry, S., & Bouhamid Alaoui, A. (2022). Analysis of reservoir sedimentation impact on water transfer systems for water scarcity alleviation in arid and semi-arid zones: Case studies from Morocco. https://doi.org/10.3850/iahr-39wc252171192022ss1079
472
+ 10. Leijnse, M., Droppers, B., & Bierkens, M. (2023). Key drivers and pressures of water scarcity at global hotspots. https://doi.org/10.5194/egusphere-egu23-4956
473
+ 11. Wang, Y., Cao, T., & Zhang, S. (2026). Long-term socioeconomic trends and climate variability as drivers of virtual water scarcity in China. *Environmental Research Letters*. https://doi.org/10.1088/1748-9326/ae4abd
474
+ 12. Boston, K. R. (2024). Resolving water scarcity in Morocco. *Pell Scholars and Senior Theses*. https://doi.org/10.18275/pbe-v042-007
475
+ 13. El Ajraoui, T. (2026). Visualizing water scarcity: A semiotic analysis of social awareness commercials in Morocco. *International Journal for Multidisciplinary Research*. https://doi.org/10.36948/ijfmr.2026.v08i02.73851
476
+ 14. Santos Pereira, L., Oweis, T., & Zairi, A. (2002). Irrigation management under water scarcity. *Agricultural Water Management, 57*(3), 175–206. https://doi.org/10.1016/s0378-3774(02)00075-6
477
+
478
+ The full 34-entry reference list is in the manuscript under [`PUBLICATION/water_scarcity_morocco.pdf`](PUBLICATION/water_scarcity_morocco.pdf).
479
+
480
+ ---
481
+
482
+ ## 📜 License
483
+
484
+ - **Code:** MIT License (see [`LICENSE`](LICENSE))
485
+ - **Manuscript and documentation:** CC-BY-4.0
486
+
487
+ ```
488
+ MIT License
489
+
490
+ Copyright (c) 2026 Samir Baladi
491
+
492
+ Permission is hereby granted, free of charge, to any person obtaining a copy
493
+ of this software and associated documentation files (the "Software"), to deal
494
+ in the Software without restriction, including without limitation the rights
495
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
496
+ copies of the Software, and to permit persons to whom the Software is
497
+ furnished to do so, subject to the following conditions:
498
+
499
+ The above copyright notice and this permission notice shall be included in
500
+ all copies or substantial portions of the Software.
501
+ ```
502
+
503
+ ---
504
+
505
+ ## 👤 Author
506
+
507
+ **Samir Baladi**
508
+ Independent Interdisciplinary Researcher
509
+ Ronin Institute / Rite of Renaissance
510
+
511
+ | Contact | Link |
512
+ |---------|------|
513
+ | Email | gitdeeper@gmail.com |
514
+ | ORCID | [https://orcid.org/0009-0003-8903-0029](https://orcid.org/0009-0003-8903-0029) |
515
+ | Zenodo | [https://doi.org/10.5281/zenodo.23884236](https://doi.org/10.5281/zenodo.23884236) |
516
+
517
+ ---
518
+
519
+ <div align="center">
520
+
521
+ **Water Scarcity in Morocco · v1.0 · November 2026**
522
+
523
+ [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.23884236-1B4F72?logo=zenodo&logoColor=white)](https://doi.org/10.5281/zenodo.23884236)
524
+ [![ORCID](https://img.shields.io/badge/ORCID-0009--0003--8903--0029-A6CE39?logo=orcid&logoColor=white)](https://orcid.org/0009-0003-8903-0029)
525
+ [![License: MIT](https://img.shields.io/badge/license-MIT-27ae60)](LICENSE)
526
+
527
+ *Exploratory Associational Analysis · Not Causally Validated*
528
+
529
+ </div>
@@ -0,0 +1,10 @@
1
+ mws_lab/__init__.py,sha256=FeaStrugV3wOnLC6pRICwkBfl4vmHvpsusnBu5obMg8,542
2
+ mws_lab/fetch.py,sha256=nOkVejmj5Yx7Wj4fRy8eCBwOY_TkdiDySk_TdfF6s0A,3344
3
+ mws_lab/data/input.json,sha256=GTbEs-GBV3W4cGdolKYYfS7SDzI02unLcotsjk0aiw0,154
4
+ mws_lab/data/worldbank_data.csv,sha256=g5EgpKPslZIpLRb-EQEjQ0O6Ung7LE52RCpiV6X_JpM,16340
5
+ mws_lab-1.0.0.dist-info/licenses/LICENSE,sha256=XKb45QLVejudAva3ugySREV4p8QRzCPicd7X9512MAE,4225
6
+ mws_lab-1.0.0.dist-info/METADATA,sha256=LO4MDSGaTLxgVpX7YXq4GGOeZb1V9bEx05xCDB9VO1c,25841
7
+ mws_lab-1.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
8
+ mws_lab-1.0.0.dist-info/entry_points.txt,sha256=uIQceqJ-gBExK7mrvNmH7Lh61YSuTBb60xbr0V_S29o,53
9
+ mws_lab-1.0.0.dist-info/top_level.txt,sha256=WbISfMxpLesXKXq39BBY8X5DD2KEFOxxiuUglCYaIYQ,8
10
+ mws_lab-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mws-lab-fetch = mws_lab.fetch:main
@@ -0,0 +1,110 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samir Baladi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ ## Scope of This License
26
+
27
+ The MIT License above applies to:
28
+
29
+ - All source code in this repository, including
30
+ `DATA/raw/fetch_worldbank_data.py` and any auxiliary scripts.
31
+ - The Python package artifacts under `PUBLICATION/dist/`
32
+ (`morocco-water-scarcity-1.0.0-py3-none-any.whl` and `.tar.gz`).
33
+ - Configuration files such as `PUBLICATION/netlify.toml`,
34
+ `PUBLICATION/ste_website_steering.json`, and `requirements.txt`.
35
+ - Build and infrastructure files (`VERSION`, `.gitignore`).
36
+
37
+ ## Separate Licensing for Manuscript, Figures, and Documentation
38
+
39
+ The following are licensed under **Creative Commons Attribution 4.0
40
+ International (CC-BY-4.0)**, not MIT:
41
+
42
+ - `PUBLICATION/water_scarcity_morocco.pdf` — the research manuscript.
43
+ - `PUBLICATION/figures/` — all seven figures (Figure 1 through Figure 7).
44
+ - `README.md` — repository documentation.
45
+ - `AUTHORS.md`, `CHANGELOG.md`, `CITATION.cff` — project documentation.
46
+ - `ANALYSIS/ANALYSIS_REPORT.md`, `ANALYSIS/analysis_insights.json` — analysis narrative.
47
+ - `docs/` — iteration log and consolidated audit report.
48
+
49
+ This distinction reflects standard practice:
50
+
51
+ - **Code** is licensed permissively (MIT) to allow reuse, modification,
52
+ and redistribution.
53
+ - **Written research artifacts** (manuscript, figures, documentation) are
54
+ licensed under CC-BY-4.0 to allow sharing and adaptation with attribution.
55
+
56
+ ## Data Licensing
57
+
58
+ The data files under `DATA/raw/` originate from the World Bank's
59
+ World Development Indicators (WDI) and Morocco's 2025 State of the
60
+ Environment Report. Their original licensing terms are governed by the
61
+ respective data providers:
62
+
63
+ - World Bank Open Data is available under the
64
+ [Creative Commons Attribution 4.0 International License (CC-BY-4.0)](https://datacatalog.worldbank.org/public-licenses).
65
+ - Indicators from Morocco's 2025 State of the Environment Report are used
66
+ for scholarly analysis; users should consult the original source for
67
+ redistribution terms.
68
+
69
+ The curated extract `DATA/raw/worldbank_data.csv` is distributed here under
70
+ CC-BY-4.0 with attribution to the World Bank.
71
+
72
+ ## Attribution
73
+
74
+ For code use:
75
+
76
+ ```
77
+
78
+ Baladi, S. (2026). Water Scarcity in Morocco: Analysis Pipeline
79
+ (Version 1.0.0) [Computer software].
80
+
81
+ ```
82
+
83
+ For manuscript or figure citation:
84
+
85
+ ```
86
+
87
+ Baladi, S. (2026). Water Scarcity in Morocco: A Multivariate Analysis of
88
+ Climatic, Agricultural, and Socioeconomic Drivers [Research manuscript,
89
+ v1.0.0]. https://doi.org/10.5281/zenodo.23884236
90
+
91
+ ```
92
+
93
+ ## Scope of the Research Claims
94
+
95
+ This work is an **exploratory and associational** analysis of Morocco's
96
+ freshwater trajectory between 2000 and 2025. It is explicitly **not**
97
+ designed to establish causal attribution. Conclusions should be read as
98
+ hypothesis-generating rather than confirmatory.
99
+
100
+ The manuscript reports an OLS model with an R-squared of 0.812 on a model
101
+ sample of n = 16. These results are conditional on the specific indicator
102
+ definitions, time window, and model specification documented in the
103
+ manuscript. Reuse of the code does not imply endorsement of the empirical
104
+ findings by the author.
105
+
106
+ ---
107
+
108
+ **Version:** 1.0.0
109
+ **Date:** 2026-11-02
110
+ **Copyright:** 2026 Samir Baladi
@@ -0,0 +1 @@
1
+ mws_lab