hdx-python-country 3.8.7__tar.gz → 3.8.9__tar.gz

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.
Files changed (52) hide show
  1. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.config/pre-commit-config.yaml +2 -2
  2. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.config/ruff.toml +0 -1
  3. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.github/workflows/publish.yaml +9 -6
  4. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.github/workflows/run-python-tests.yaml +4 -0
  5. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.gitignore +3 -0
  6. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/PKG-INFO +4 -2
  7. hdx_python_country-3.8.9/documentation/.readthedocs.yaml +14 -0
  8. hdx_python_country-3.8.7/documentation/main.md → hdx_python_country-3.8.9/documentation/index.md +5 -4
  9. hdx_python_country-3.8.9/documentation/mkdocs.yaml +17 -0
  10. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/pyproject.toml +3 -3
  11. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/requirements.txt +91 -26
  12. hdx_python_country-3.8.9/src/hdx/location/Countries & Territories Taxonomy MVP - C&T Taxonomy with HXL Tags.csv +258 -0
  13. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/_version.py +9 -4
  14. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/adminlevel.py +21 -59
  15. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/country.py +77 -53
  16. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/currency.py +8 -24
  17. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/wfp_exchangerates.py +17 -8
  18. hdx_python_country-3.8.9/tests/hdx/location/Countries_UZB_Deleted.csv +257 -0
  19. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/hdx/location/test_adminlevel.py +58 -73
  20. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/hdx/location/test_country.py +46 -56
  21. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/hdx/location/test_currency.py +17 -64
  22. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/hdx/location/test_wfp_exchangerates.py +3 -4
  23. hdx_python_country-3.8.7/documentation/.readthedocs.yaml +0 -16
  24. hdx_python_country-3.8.7/documentation/pydoc-markdown.yaml +0 -32
  25. hdx_python_country-3.8.7/src/hdx/location/Countries & Territories Taxonomy MVP - C&T Taxonomy with HXL Tags.csv +0 -258
  26. hdx_python_country-3.8.7/tests/hdx/location/Countries_UZB_Deleted.csv +0 -257
  27. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.config/coveragerc +0 -0
  28. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/.config/pytest.ini +0 -0
  29. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/CONTRIBUTING.md +0 -0
  30. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/LICENSE +0 -0
  31. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/README.md +0 -0
  32. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/__init__.py +0 -0
  33. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/src/hdx/location/wfp_api.py +0 -0
  34. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/adminlevel.yaml +0 -0
  35. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/adminlevelparent.yaml +0 -0
  36. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/download-global-pcode-lengths.csv +0 -0
  37. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/download-global-pcodes-adm-1-2.csv +0 -0
  38. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/secondary_historic_rates.csv +0 -0
  39. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/secondary_rates.json +0 -0
  40. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_List_1.json +0 -0
  41. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_List_2.json +0 -0
  42. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_1.json +0 -0
  43. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_10.json +0 -0
  44. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_2.json +0 -0
  45. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_3.json +0 -0
  46. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_4.json +0 -0
  47. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_5.json +0 -0
  48. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_6.json +0 -0
  49. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_7.json +0 -0
  50. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_8.json +0 -0
  51. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_9.json +0 -0
  52. {hdx_python_country-3.8.7 → hdx_python_country-3.8.9}/tests/hdx/location/__init__.py +0 -0
@@ -8,7 +8,7 @@ repos:
8
8
  - id: end-of-file-fixer
9
9
  - id: check-ast
10
10
  - repo: https://github.com/astral-sh/ruff-pre-commit
11
- rev: v0.8.6
11
+ rev: v0.9.10
12
12
  hooks:
13
13
  # Run the linter.
14
14
  - id: ruff
@@ -17,7 +17,7 @@ repos:
17
17
  - id: ruff-format
18
18
  args: [--config, .config/ruff.toml]
19
19
  - repo: https://github.com/astral-sh/uv-pre-commit
20
- rev: 0.5.15
20
+ rev: 0.6.5
21
21
  hooks:
22
22
  # Run the pip compile
23
23
  - id: pip-compile
@@ -1,4 +1,3 @@
1
- line-length = 79
2
1
  exclude = ["_version.py"]
3
2
 
4
3
  [lint]
@@ -8,6 +8,13 @@ jobs:
8
8
  publish:
9
9
  runs-on: ubuntu-latest
10
10
 
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/hdx-python-utilities
14
+
15
+ permissions:
16
+ id-token: write # IMPORTANT: mandatory for trusted publishing
17
+
11
18
  steps:
12
19
  - uses: actions/checkout@v4
13
20
  - name: Get history and tags for versioning to work
@@ -26,9 +33,5 @@ jobs:
26
33
  - name: Build with hatch
27
34
  run: |
28
35
  hatch build
29
- - name: Publish with hatch
30
- env:
31
- HATCH_INDEX_USER: ${{secrets.HATCH_INDEX_USER}}
32
- HATCH_INDEX_AUTH: ${{secrets.HATCH_INDEX_AUTH}}
33
- run: |
34
- hatch publish
36
+ - name: Publish distribution 📦 to PyPI
37
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -17,6 +17,10 @@ jobs:
17
17
  build:
18
18
  runs-on: ubuntu-latest
19
19
 
20
+ permissions:
21
+ checks: write
22
+ pull-requests: write
23
+
20
24
  steps:
21
25
  - uses: actions/checkout@v4
22
26
  - name: Set up Python
@@ -96,3 +96,6 @@ ENV/
96
96
 
97
97
  # hatch-vcs
98
98
  _version.py
99
+
100
+ # Mac files
101
+ .DS_Store
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hdx-python-country
3
- Version: 3.8.7
3
+ Version: 3.8.9
4
4
  Summary: HDX Python country code and exchange rate (fx) utilities
5
5
  Project-URL: Homepage, https://github.com/OCHA-DAP/hdx-python-country
6
6
  Author: Michael Rans
@@ -25,11 +25,13 @@ Classifier: Programming Language :: Python :: 3.11
25
25
  Classifier: Programming Language :: Python :: 3.12
26
26
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
27
  Requires-Python: >=3.8
28
- Requires-Dist: hdx-python-utilities>=3.8.0
28
+ Requires-Dist: hdx-python-utilities>=3.8.5
29
29
  Requires-Dist: libhxl>=5.2.2
30
30
  Requires-Dist: tenacity
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: pre-commit; extra == 'dev'
33
+ Provides-Extra: docs
34
+ Requires-Dist: mkapi; extra == 'docs'
33
35
  Provides-Extra: test
34
36
  Requires-Dist: pytest; extra == 'test'
35
37
  Requires-Dist: pytest-cov; extra == 'test'
@@ -0,0 +1,14 @@
1
+ # Required
2
+ version: 2
3
+
4
+ # Set the version of Python and other tools you might need
5
+ build:
6
+ os: ubuntu-24.04
7
+ tools:
8
+ python: "3.12"
9
+ jobs:
10
+ pre_build:
11
+ - pip install .[docs]
12
+
13
+ mkdocs:
14
+ configuration: documentation/mkdocs.yaml
@@ -101,10 +101,11 @@ The usage of the country mappings functionality is best illustrated by some exam
101
101
  # "#country+name+preferred": "Japan", "#country+name+short+v_reliefweb": "",
102
102
  # "#country+regex": "japan", "#currency+code": "JPY", "#date+start": "1974-01-01",
103
103
  # "#geo+admin_level": "0", "#geo+lat": "37.63209801", "#geo+lon": "138.0812256",
104
- # "#indicator+incomelevel": "High", "#meta+bool+deprecated": "N", "#meta+bool+independent": "Y",
105
- # "#meta+id": "112", "#region+code+intermediate": "", "#region+code+main": "142",
106
- # "#region+code+sub": "30", "#region+intermediate+name+preferred": "",
107
- # "#region+main+name+preferred": "Asia", "#region+name+preferred+sub": "Eastern Asia"}
104
+ # "#indicator+bool+hrp": "", "#indicator+bool+gho": "", "#indicator+incomelevel": "High",
105
+ # "#meta+bool+deprecated": "N", "#meta+bool+independent": "Y", "#meta+id": "112",
106
+ # "#region+code+intermediate": "", "#region+code+main": "142", "#region+code+sub": "30",
107
+ # "#region+intermediate+name+preferred": "", "#region+main+name+preferred": "Asia",
108
+ # "#region+name+preferred+sub": "Eastern Asia"}
108
109
  Country.get_countries_in_region("Channel Islands")
109
110
  # ["GGY", "JEY"]
110
111
  len(Country.get_countries_in_region("Africa"))
@@ -0,0 +1,17 @@
1
+ site_name: HDX Python Country
2
+ repo_url: https://github.com/OCHA-DAP/hdx-python-country/
3
+ repo_name: OCHA-DAP/hdx-python-country
4
+ docs_dir: .
5
+ site_dir: ../site
6
+ theme:
7
+ name: material
8
+ highlightjs: true
9
+ plugins:
10
+ - search
11
+ - mkapi
12
+ nav:
13
+ - Home: index.md
14
+ - API Documentation:
15
+ - Countries: $src/hdx.location.country.*
16
+ - Administration Level: $src/hdx.location.adminlevel.*
17
+ - Currencies: $src/hdx.location.currency.*
@@ -34,7 +34,7 @@ classifiers = [
34
34
  requires-python = ">=3.8"
35
35
 
36
36
  dependencies = [
37
- "hdx-python-utilities>=3.8.0",
37
+ "hdx-python-utilities>=3.8.5",
38
38
  "libhxl>=5.2.2",
39
39
  "tenacity",
40
40
  ]
@@ -50,7 +50,7 @@ Homepage = "https://github.com/OCHA-DAP/hdx-python-country"
50
50
  [project.optional-dependencies]
51
51
  test = ["pytest", "pytest-cov"]
52
52
  dev = ["pre-commit"]
53
-
53
+ docs = ["mkapi"]
54
54
 
55
55
  #########
56
56
  # Hatch #
@@ -92,7 +92,7 @@ run = """
92
92
  """
93
93
 
94
94
  [tool.hatch.envs.hatch-static-analysis]
95
- dependencies = ["ruff==0.8.6"]
95
+ dependencies = ["ruff==0.9.10"]
96
96
 
97
97
  [tool.hatch.envs.hatch-static-analysis.scripts]
98
98
  format-check = ["ruff format --config .config/ruff.toml --check --diff {args:.}",]
@@ -2,13 +2,19 @@
2
2
  # uv pip compile pyproject.toml --resolver=backtracking --all-extras -o requirements.txt
3
3
  annotated-types==0.7.0
4
4
  # via pydantic
5
- attrs==24.3.0
5
+ astdoc==1.1.5
6
+ # via mkapi
7
+ attrs==25.3.0
6
8
  # via
7
9
  # frictionless
8
10
  # jsonlines
9
11
  # jsonschema
10
12
  # referencing
11
- certifi==2024.12.14
13
+ babel==2.17.0
14
+ # via mkdocs-material
15
+ backrefs==5.8
16
+ # via mkdocs-material
17
+ certifi==2025.1.31
12
18
  # via requests
13
19
  cfgv==3.4.0
14
20
  # via pre-commit
@@ -17,33 +23,43 @@ chardet==5.2.0
17
23
  charset-normalizer==3.4.1
18
24
  # via requests
19
25
  click==8.1.8
20
- # via typer
21
- coverage==7.6.10
26
+ # via
27
+ # mkdocs
28
+ # typer
29
+ colorama==0.4.6
30
+ # via mkdocs-material
31
+ coverage==7.7.0
22
32
  # via pytest-cov
23
33
  distlib==0.3.9
24
34
  # via virtualenv
25
35
  et-xmlfile==2.0.0
26
36
  # via openpyxl
27
- filelock==3.16.1
37
+ filelock==3.18.0
28
38
  # via virtualenv
29
39
  frictionless==5.18.0
30
40
  # via hdx-python-utilities
31
- hdx-python-utilities==3.8.0
41
+ ghp-import==2.1.0
42
+ # via mkdocs
43
+ hdx-python-utilities==3.8.5
32
44
  # via hdx-python-country (pyproject.toml)
33
- humanize==4.11.0
45
+ humanize==4.12.1
34
46
  # via frictionless
35
- identify==2.6.5
47
+ identify==2.6.9
36
48
  # via pre-commit
37
49
  idna==3.10
38
50
  # via requests
39
51
  ijson==3.3.0
40
52
  # via hdx-python-utilities
41
- iniconfig==2.0.0
53
+ iniconfig==2.1.0
42
54
  # via pytest
43
55
  isodate==0.7.2
44
56
  # via frictionless
45
- jinja2==3.1.5
46
- # via frictionless
57
+ jinja2==3.1.6
58
+ # via
59
+ # frictionless
60
+ # mkapi
61
+ # mkdocs
62
+ # mkdocs-material
47
63
  jsonlines==4.0.0
48
64
  # via hdx-python-utilities
49
65
  jsonpath-ng==1.7.0
@@ -58,41 +74,77 @@ libhxl==5.2.2
58
74
  # via hdx-python-country (pyproject.toml)
59
75
  loguru==0.7.3
60
76
  # via hdx-python-utilities
77
+ markdown==3.7
78
+ # via
79
+ # astdoc
80
+ # mkdocs
81
+ # mkdocs-material
82
+ # pymdown-extensions
61
83
  markdown-it-py==3.0.0
62
84
  # via rich
63
85
  marko==2.1.2
64
86
  # via frictionless
65
87
  markupsafe==3.0.2
66
- # via jinja2
88
+ # via
89
+ # jinja2
90
+ # mkdocs
67
91
  mdurl==0.1.2
68
92
  # via markdown-it-py
93
+ mergedeep==1.3.4
94
+ # via
95
+ # mkdocs
96
+ # mkdocs-get-deps
97
+ mkapi==4.1.3
98
+ # via hdx-python-country (pyproject.toml)
99
+ mkdocs==1.6.1
100
+ # via
101
+ # mkapi
102
+ # mkdocs-material
103
+ mkdocs-get-deps==0.2.0
104
+ # via mkdocs
105
+ mkdocs-material==9.6.9
106
+ # via mkapi
107
+ mkdocs-material-extensions==1.3.1
108
+ # via mkdocs-material
69
109
  nodeenv==1.9.1
70
110
  # via pre-commit
71
111
  openpyxl==3.1.5
72
112
  # via hdx-python-utilities
73
113
  packaging==24.2
74
- # via pytest
114
+ # via
115
+ # mkdocs
116
+ # pytest
117
+ paginate==0.5.7
118
+ # via mkdocs-material
119
+ pathspec==0.12.1
120
+ # via mkdocs
75
121
  petl==1.7.15
76
122
  # via frictionless
77
- platformdirs==4.3.6
78
- # via virtualenv
123
+ platformdirs==4.3.7
124
+ # via
125
+ # mkdocs-get-deps
126
+ # virtualenv
79
127
  pluggy==1.5.0
80
128
  # via pytest
81
129
  ply==3.11
82
130
  # via
83
131
  # jsonpath-ng
84
132
  # libhxl
85
- pre-commit==4.0.1
133
+ pre-commit==4.2.0
86
134
  # via hdx-python-country (pyproject.toml)
87
- pydantic==2.10.5
135
+ pydantic==2.10.6
88
136
  # via frictionless
89
137
  pydantic-core==2.27.2
90
138
  # via pydantic
91
139
  pygments==2.19.1
92
- # via rich
140
+ # via
141
+ # mkdocs-material
142
+ # rich
143
+ pymdown-extensions==10.14.3
144
+ # via mkdocs-material
93
145
  pyphonetics==0.5.3
94
146
  # via hdx-python-utilities
95
- pytest==8.3.4
147
+ pytest==8.3.5
96
148
  # via
97
149
  # hdx-python-country (pyproject.toml)
98
150
  # pytest-cov
@@ -101,6 +153,7 @@ pytest-cov==6.0.0
101
153
  python-dateutil==2.9.0.post0
102
154
  # via
103
155
  # frictionless
156
+ # ghp-import
104
157
  # hdx-python-utilities
105
158
  # libhxl
106
159
  python-io-wrapper==0.3.1
@@ -110,11 +163,17 @@ python-slugify==8.0.4
110
163
  pyyaml==6.0.2
111
164
  # via
112
165
  # frictionless
166
+ # mkdocs
167
+ # mkdocs-get-deps
113
168
  # pre-commit
169
+ # pymdown-extensions
170
+ # pyyaml-env-tag
114
171
  # tableschema-to-template
172
+ pyyaml-env-tag==0.1
173
+ # via mkdocs
115
174
  ratelimit==2.2.1
116
175
  # via hdx-python-utilities
117
- referencing==0.35.1
176
+ referencing==0.36.2
118
177
  # via
119
178
  # jsonschema
120
179
  # jsonschema-specifications
@@ -122,14 +181,17 @@ requests==2.32.3
122
181
  # via
123
182
  # frictionless
124
183
  # libhxl
184
+ # mkdocs-material
125
185
  # requests-file
126
186
  requests-file==2.1.0
127
187
  # via hdx-python-utilities
128
188
  rfc3986==2.0.0
129
189
  # via frictionless
130
190
  rich==13.9.4
131
- # via typer
132
- rpds-py==0.22.3
191
+ # via
192
+ # mkapi
193
+ # typer
194
+ rpds-py==0.23.1
133
195
  # via
134
196
  # jsonschema
135
197
  # referencing
@@ -145,7 +207,7 @@ six==1.17.0
145
207
  # via python-dateutil
146
208
  stringcase==1.2.0
147
209
  # via frictionless
148
- structlog==24.4.0
210
+ structlog==25.2.0
149
211
  # via libhxl
150
212
  tableschema-to-template==0.0.13
151
213
  # via hdx-python-utilities
@@ -155,13 +217,14 @@ tenacity==9.0.0
155
217
  # via hdx-python-country (pyproject.toml)
156
218
  text-unidecode==1.3
157
219
  # via python-slugify
158
- typer==0.15.1
220
+ typer==0.15.2
159
221
  # via frictionless
160
222
  typing-extensions==4.12.2
161
223
  # via
162
224
  # frictionless
163
225
  # pydantic
164
226
  # pydantic-core
227
+ # referencing
165
228
  # typer
166
229
  unidecode==1.3.8
167
230
  # via
@@ -173,8 +236,10 @@ urllib3==2.3.0
173
236
  # requests
174
237
  validators==0.34.0
175
238
  # via frictionless
176
- virtualenv==20.28.1
239
+ virtualenv==20.29.3
177
240
  # via pre-commit
241
+ watchdog==6.0.0
242
+ # via mkdocs
178
243
  wheel==0.45.1
179
244
  # via libhxl
180
245
  xlrd==2.0.1
@@ -183,7 +248,7 @@ xlrd3==1.1.0
183
248
  # via libhxl
184
249
  xlsx2csv==0.8.4
185
250
  # via hdx-python-utilities
186
- xlsxwriter==3.2.0
251
+ xlsxwriter==3.2.2
187
252
  # via tableschema-to-template
188
253
  xlwt==1.3.0
189
254
  # via hdx-python-utilities