hdx-python-country 3.7.0__tar.gz → 3.7.1__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 (36) hide show
  1. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.config/pre-commit-config.yaml +5 -4
  2. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.config/ruff.toml +0 -1
  3. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/PKG-INFO +2 -2
  4. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/documentation/.readthedocs.yaml +1 -0
  5. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/documentation/pydoc-markdown.yaml +3 -3
  6. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/pyproject.toml +1 -1
  7. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/requirements.txt +37 -35
  8. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/_version.py +2 -2
  9. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/adminlevel.py +13 -0
  10. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/hdx/location/test_adminlevel.py +6 -1
  11. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.config/coveragerc +0 -0
  12. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.config/pytest.ini +0 -0
  13. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.github/workflows/publish.yaml +0 -0
  14. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.github/workflows/run-python-tests.yaml +0 -0
  15. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/.gitignore +0 -0
  16. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/CONTRIBUTING.md +0 -0
  17. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/LICENSE +0 -0
  18. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/README.md +0 -0
  19. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/documentation/main.md +0 -0
  20. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/Countries & Territories Taxonomy MVP - C&T Taxonomy with HXL Tags.csv +0 -0
  21. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/__init__.py +0 -0
  22. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/country.py +0 -0
  23. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/currency.py +0 -0
  24. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/names.py +0 -0
  25. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/phonetics.py +0 -0
  26. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/src/hdx/location/wfp_exchangerates.py +0 -0
  27. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/fixtures/adminlevel.yaml +0 -0
  28. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/fixtures/global_pcode_lengths.csv +0 -0
  29. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/fixtures/global_pcodes_adm_1_2.csv +0 -0
  30. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/fixtures/secondary_historic_rates.csv +0 -0
  31. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/fixtures/secondary_rates.json +0 -0
  32. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/hdx/location/Countries_UZB_Deleted.csv +0 -0
  33. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/hdx/location/__init__.py +0 -0
  34. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/hdx/location/test_country.py +0 -0
  35. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/hdx/location/test_currency.py +0 -0
  36. {hdx_python_country-3.7.0 → hdx_python_country-3.7.1}/tests/hdx/location/test_wfp_exchangerates.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.3.2
11
+ rev: v0.4.4
12
12
  hooks:
13
13
  # Run the linter.
14
14
  - id: ruff
@@ -16,10 +16,11 @@ repos:
16
16
  # Run the formatter.
17
17
  - id: ruff-format
18
18
  args: [--config, .config/ruff.toml]
19
- - repo: https://github.com/jazzband/pip-tools
20
- rev: 7.4.1
19
+ - repo: https://github.com/astral-sh/uv-pre-commit
20
+ rev: 0.1.45
21
21
  hooks:
22
+ # Run the pip compile
22
23
  - id: pip-compile
23
24
  name: pip-compile requirements.txt
24
25
  files: pyproject.toml
25
- args: [pyproject.toml, --resolver=backtracking, --all-extras, --upgrade, -q, -o, requirements.txt]
26
+ args: [ pyproject.toml, --resolver=backtracking, --all-extras, --upgrade, -q, -o, requirements.txt ]
@@ -12,6 +12,5 @@ ignore = [
12
12
  "E501" # Line too long
13
13
  ]
14
14
 
15
-
16
15
  [lint.isort]
17
16
  known-local-folder = ["hdx"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hdx-python-country
3
- Version: 3.7.0
3
+ Version: 3.7.1
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,7 +25,7 @@ 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.6.7
28
+ Requires-Dist: hdx-python-utilities>=3.6.8
29
29
  Requires-Dist: libhxl>=5.2.1
30
30
  Requires-Dist: pyphonetics
31
31
  Provides-Extra: dev
@@ -11,5 +11,6 @@ build:
11
11
  jobs:
12
12
  pre_build:
13
13
  - pip install --upgrade mkdocs
14
+ - pip install mkdocs-material
14
15
  - pip install pydoc-markdown
15
16
  - pydoc-markdown documentation/pydoc-markdown.yaml
@@ -9,7 +9,7 @@ renderer:
9
9
  output_directory: docs
10
10
  mkdocs_config:
11
11
  site_name: HDX Python Country
12
- theme: mkdocs
12
+ theme: material
13
13
  repo_url: "https://github.com/OCHA-DAP/hdx-python-country"
14
14
  markdown:
15
15
  source_linker:
@@ -24,9 +24,9 @@ renderer:
24
24
  - title: Countries
25
25
  contents:
26
26
  - hdx.location.country.*
27
- - title: Administration level one
27
+ - title: Administration Level
28
28
  contents:
29
- - hdx.location.adminone.*
29
+ - hdx.location.adminlevel.*
30
30
  - title: Currencies
31
31
  contents:
32
32
  - hdx.location.currency.*
@@ -34,7 +34,7 @@ classifiers = [
34
34
  requires-python = ">=3.8"
35
35
 
36
36
  dependencies = [
37
- "hdx-python-utilities>=3.6.7",
37
+ "hdx-python-utilities>=3.6.8",
38
38
  "libhxl>=5.2.1",
39
39
  "pyphonetics",
40
40
  ]
@@ -1,16 +1,13 @@
1
- #
2
- # This file is autogenerated by pip-compile with Python 3.11
3
- # by the following command:
4
- #
5
- # pip-compile --all-extras --output-file=requirements.txt pyproject.toml
6
- #
7
- annotated-types==0.6.0
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv pip compile pyproject.toml --resolver=backtracking --all-extras -o requirements.txt
3
+ annotated-types==0.7.0
8
4
  # via pydantic
9
5
  attrs==23.2.0
10
6
  # via
11
7
  # frictionless
12
8
  # jsonlines
13
9
  # jsonschema
10
+ # referencing
14
11
  certifi==2024.2.2
15
12
  # via requests
16
13
  cfgv==3.4.0
@@ -21,25 +18,23 @@ charset-normalizer==3.3.2
21
18
  # via requests
22
19
  click==8.1.7
23
20
  # via typer
24
- colorama==0.4.6
25
- # via typer
26
- coverage[toml]==7.4.4
21
+ coverage==7.5.1
27
22
  # via pytest-cov
28
23
  distlib==0.3.8
29
24
  # via virtualenv
30
25
  et-xmlfile==1.1.0
31
26
  # via openpyxl
32
- filelock==3.13.3
27
+ filelock==3.14.0
33
28
  # via virtualenv
34
- frictionless==5.16.1
29
+ frictionless==5.17.0
35
30
  # via hdx-python-utilities
36
- hdx-python-utilities==3.6.7
31
+ hdx-python-utilities==3.6.8
37
32
  # via hdx-python-country (pyproject.toml)
38
33
  humanize==4.9.0
39
34
  # via frictionless
40
- identify==2.5.35
35
+ identify==2.5.36
41
36
  # via pre-commit
42
- idna==3.6
37
+ idna==3.7
43
38
  # via requests
44
39
  ijson==3.2.3
45
40
  # via hdx-python-utilities
@@ -47,16 +42,18 @@ iniconfig==2.0.0
47
42
  # via pytest
48
43
  isodate==0.6.1
49
44
  # via frictionless
50
- jinja2==3.1.3
45
+ jinja2==3.1.4
51
46
  # via frictionless
52
47
  jsonlines==4.0.0
53
48
  # via hdx-python-utilities
54
49
  jsonpath-ng==1.6.1
55
50
  # via libhxl
56
- jsonschema==4.17.3
51
+ jsonschema==4.22.0
57
52
  # via
58
53
  # frictionless
59
54
  # tableschema-to-template
55
+ jsonschema-specifications==2023.12.1
56
+ # via jsonschema
60
57
  libhxl==5.2.1
61
58
  # via hdx-python-country (pyproject.toml)
62
59
  loguru==0.7.2
@@ -77,27 +74,25 @@ packaging==24.0
77
74
  # via pytest
78
75
  petl==1.7.15
79
76
  # via frictionless
80
- platformdirs==4.2.0
77
+ platformdirs==4.2.2
81
78
  # via virtualenv
82
- pluggy==1.4.0
79
+ pluggy==1.5.0
83
80
  # via pytest
84
81
  ply==3.11
85
82
  # via
86
83
  # jsonpath-ng
87
84
  # libhxl
88
- pre-commit==3.7.0
85
+ pre-commit==3.7.1
89
86
  # via hdx-python-country (pyproject.toml)
90
- pydantic==2.6.4
87
+ pydantic==2.7.1
91
88
  # via frictionless
92
- pydantic-core==2.16.3
89
+ pydantic-core==2.18.2
93
90
  # via pydantic
94
- pygments==2.17.2
91
+ pygments==2.18.0
95
92
  # via rich
96
93
  pyphonetics==0.5.3
97
94
  # via hdx-python-country (pyproject.toml)
98
- pyrsistent==0.20.0
99
- # via jsonschema
100
- pytest==8.1.1
95
+ pytest==8.2.1
101
96
  # via
102
97
  # hdx-python-country (pyproject.toml)
103
98
  # pytest-cov
@@ -119,21 +114,31 @@ pyyaml==6.0.1
119
114
  # tableschema-to-template
120
115
  ratelimit==2.2.1
121
116
  # via hdx-python-utilities
122
- requests==2.31.0
117
+ referencing==0.35.1
118
+ # via
119
+ # jsonschema
120
+ # jsonschema-specifications
121
+ requests==2.32.2
123
122
  # via
124
123
  # frictionless
125
124
  # libhxl
126
125
  # requests-file
127
- requests-file==2.0.0
126
+ requests-file==2.1.0
128
127
  # via hdx-python-utilities
129
128
  rfc3986==2.0.0
130
129
  # via frictionless
131
130
  rich==13.7.1
132
131
  # via typer
132
+ rpds-py==0.18.1
133
+ # via
134
+ # jsonschema
135
+ # referencing
133
136
  ruamel-yaml==0.18.6
134
137
  # via hdx-python-utilities
135
138
  ruamel-yaml-clib==0.2.8
136
139
  # via ruamel-yaml
140
+ setuptools==70.0.0
141
+ # via nodeenv
137
142
  shellingham==1.5.4
138
143
  # via typer
139
144
  simpleeval==0.9.13
@@ -152,9 +157,9 @@ tabulate==0.9.0
152
157
  # via frictionless
153
158
  text-unidecode==1.3
154
159
  # via python-slugify
155
- typer[all]==0.10.0
160
+ typer==0.12.3
156
161
  # via frictionless
157
- typing-extensions==4.10.0
162
+ typing-extensions==4.11.0
158
163
  # via
159
164
  # frictionless
160
165
  # pydantic
@@ -168,9 +173,9 @@ urllib3==2.2.1
168
173
  # via
169
174
  # libhxl
170
175
  # requests
171
- validators==0.24.0
176
+ validators==0.28.1
172
177
  # via frictionless
173
- virtualenv==20.25.1
178
+ virtualenv==20.26.2
174
179
  # via pre-commit
175
180
  wheel==0.43.0
176
181
  # via libhxl
@@ -182,6 +187,3 @@ xlsxwriter==3.2.0
182
187
  # via tableschema-to-template
183
188
  xlwt==1.3.0
184
189
  # via hdx-python-utilities
185
-
186
- # The following packages are considered to be unsafe in a requirements file:
187
- # setuptools
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '3.7.0'
16
- __version_tuple__ = version_tuple = (3, 7, 0)
15
+ __version__ = version = '3.7.1'
16
+ __version_tuple__ = version_tuple = (3, 7, 1)
@@ -743,3 +743,16 @@ class AdminLevel:
743
743
  logger.error(line)
744
744
  output.append(line)
745
745
  return output
746
+
747
+ def output_admin_name_mappings(self) -> List[str]:
748
+ """Output log of name mappings
749
+
750
+ Returns:
751
+ List[str]: List of mappings
752
+ """
753
+ output = []
754
+ for name, pcode in self.admin_name_mappings.items():
755
+ line = f"{name}: {self.pcode_to_name[pcode]} ({pcode})"
756
+ logger.info(line)
757
+ output.append(line)
758
+ return output
@@ -155,6 +155,11 @@ class TestAdminLevel:
155
155
  "test - Could not find ABC in map names!",
156
156
  "test - NER: Could not find ABCDEFGH in map names!",
157
157
  ]
158
+ output = adminone.output_admin_name_mappings()
159
+ assert len(output) == 62
160
+ assert output[0] == "Nord-Ouest: North West (HT09)"
161
+ assert output[31] == "Juba Dhexe: Middle Juba (SO27)"
162
+ assert output[61] == "CU Niamey: Niamey (NER008)"
158
163
 
159
164
  def test_adminlevel_fuzzy(self, config):
160
165
  adminone = AdminLevel(config)
@@ -231,7 +236,7 @@ class TestAdminLevel:
231
236
  adminone = AdminLevel(config)
232
237
  adminone.setup_from_url()
233
238
  assert adminone.get_admin_level("YEM") == 1
234
- assert len(adminone.get_pcode_list()) == 2506
239
+ assert len(adminone.get_pcode_list()) == 2509
235
240
  assert adminone.get_pcode_length("YEM") == 4
236
241
  assert adminone.get_pcode("YEM", "YE30", logname="test") == (
237
242
  "YE30",