hdx-python-country 3.9.2__tar.gz → 3.9.3__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.
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/.github/workflows/publish.yaml +1 -1
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/PKG-INFO +90 -2
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/README.md +88 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/pyproject.toml +1 -1
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/requirements.txt +36 -36
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/_version.py +2 -2
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/country.py +1 -1
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/test_country.py +8 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/test_currency.py +9 -1
- hdx_python_country-3.9.2/CONTRIBUTING.md +0 -53
- /hdx_python_country-3.9.2/coveragerc → /hdx_python_country-3.9.3/.coveragerc +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/.github/workflows/run-python-tests.yaml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/.gitignore +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/.pre-commit-config.yaml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/LICENSE +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/documentation/index.md +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/documentation/mkdocs.yaml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/hatch.toml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/pytest.ini +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/ruff.toml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/Countries & Territories Taxonomy MVP - C&T Taxonomy with HXL Tags.csv +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/__init__.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/adminlevel.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/currency.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/int_timestamp.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/wfp_api.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/src/hdx/location/wfp_exchangerates.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/adminlevel.yaml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/adminlevelparent.yaml +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/download-global-pcode-lengths.csv +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/download-global-pcodes-adm-1-2.csv +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/secondary_historic_rates.csv +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/secondary_rates.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_List_1.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_List_2.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_1.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_10.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_2.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_3.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_4.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_5.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_6.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_7.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_8.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_UsdIndirectQuotation_9.json +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/Countries_UZB_Deleted.csv +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/__init__.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/conftest.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/test_adminlevel.py +0 -0
- {hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/test_wfp_exchangerates.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hdx-python-country
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.3
|
|
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.8.
|
|
28
|
+
Requires-Dist: hdx-python-utilities>=3.8.6
|
|
29
29
|
Requires-Dist: libhxl>=5.2.2
|
|
30
30
|
Requires-Dist: tenacity
|
|
31
31
|
Provides-Extra: dev
|
|
@@ -69,3 +69,91 @@ For more information, please read the [documentation](https://hdx-python-country
|
|
|
69
69
|
This library is part of the [Humanitarian Data Exchange](https://data.humdata.org/)
|
|
70
70
|
(HDX) project. If you have humanitarian related data, please upload your datasets to
|
|
71
71
|
HDX.
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
### Environment
|
|
76
|
+
|
|
77
|
+
Development is currently done using Python 3.12. We recommend using a virtual
|
|
78
|
+
environment such as ``venv``:
|
|
79
|
+
|
|
80
|
+
```shell
|
|
81
|
+
python -m venv venv
|
|
82
|
+
source venv/bin/activate
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
In your virtual environment, install all packages for development by running:
|
|
86
|
+
|
|
87
|
+
```shell
|
|
88
|
+
pip install -r requirements.txt
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Pre-commit
|
|
92
|
+
|
|
93
|
+
Be sure to install `pre-commit`, which is run every time you make a git commit:
|
|
94
|
+
|
|
95
|
+
```shell
|
|
96
|
+
pip install pre-commit
|
|
97
|
+
pre-commit install
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
With pre-commit, all code is formatted according to
|
|
101
|
+
[ruff](https://docs.astral.sh/ruff/) guidelines.
|
|
102
|
+
|
|
103
|
+
To check if your changes pass pre-commit without committing, run:
|
|
104
|
+
|
|
105
|
+
```shell
|
|
106
|
+
pre-commit run --all-files
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Testing
|
|
110
|
+
|
|
111
|
+
Ensure you have the required packages to run the tests:
|
|
112
|
+
|
|
113
|
+
```shell
|
|
114
|
+
pip install -r requirements.txt
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
To run the tests and view coverage, execute:
|
|
118
|
+
|
|
119
|
+
```shell
|
|
120
|
+
pytest -c --cov hdx
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Packages
|
|
124
|
+
|
|
125
|
+
[uv](https://github.com/astral-sh/uv) is used for package management. If
|
|
126
|
+
you’ve introduced a new package to the source code (i.e. anywhere in `src/`),
|
|
127
|
+
please add it to the `project.dependencies` section of `pyproject.toml` with
|
|
128
|
+
any known version constraints.
|
|
129
|
+
|
|
130
|
+
To add packages required only for testing, add them to the `test` section under
|
|
131
|
+
`[project.optional-dependencies]`.
|
|
132
|
+
|
|
133
|
+
Any changes to the dependencies will be automatically reflected in
|
|
134
|
+
`requirements.txt` with `pre-commit`, but you can re-generate the file without
|
|
135
|
+
committing by executing:
|
|
136
|
+
|
|
137
|
+
```shell
|
|
138
|
+
pre-commit run pip-compile --all-files
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Project
|
|
142
|
+
|
|
143
|
+
[Hatch](https://hatch.pypa.io/) is used for project management. The project can be built using:
|
|
144
|
+
|
|
145
|
+
```shell
|
|
146
|
+
hatch build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Linting and syntax checking can be run with:
|
|
150
|
+
|
|
151
|
+
```shell
|
|
152
|
+
hatch fmt --check
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Tests can be executed using:
|
|
156
|
+
|
|
157
|
+
```shell
|
|
158
|
+
hatch test
|
|
159
|
+
```
|
|
@@ -30,3 +30,91 @@ For more information, please read the [documentation](https://hdx-python-country
|
|
|
30
30
|
This library is part of the [Humanitarian Data Exchange](https://data.humdata.org/)
|
|
31
31
|
(HDX) project. If you have humanitarian related data, please upload your datasets to
|
|
32
32
|
HDX.
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
### Environment
|
|
37
|
+
|
|
38
|
+
Development is currently done using Python 3.12. We recommend using a virtual
|
|
39
|
+
environment such as ``venv``:
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
python -m venv venv
|
|
43
|
+
source venv/bin/activate
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
In your virtual environment, install all packages for development by running:
|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
pip install -r requirements.txt
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Pre-commit
|
|
53
|
+
|
|
54
|
+
Be sure to install `pre-commit`, which is run every time you make a git commit:
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
pip install pre-commit
|
|
58
|
+
pre-commit install
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
With pre-commit, all code is formatted according to
|
|
62
|
+
[ruff](https://docs.astral.sh/ruff/) guidelines.
|
|
63
|
+
|
|
64
|
+
To check if your changes pass pre-commit without committing, run:
|
|
65
|
+
|
|
66
|
+
```shell
|
|
67
|
+
pre-commit run --all-files
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Testing
|
|
71
|
+
|
|
72
|
+
Ensure you have the required packages to run the tests:
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
pip install -r requirements.txt
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
To run the tests and view coverage, execute:
|
|
79
|
+
|
|
80
|
+
```shell
|
|
81
|
+
pytest -c --cov hdx
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Packages
|
|
85
|
+
|
|
86
|
+
[uv](https://github.com/astral-sh/uv) is used for package management. If
|
|
87
|
+
you’ve introduced a new package to the source code (i.e. anywhere in `src/`),
|
|
88
|
+
please add it to the `project.dependencies` section of `pyproject.toml` with
|
|
89
|
+
any known version constraints.
|
|
90
|
+
|
|
91
|
+
To add packages required only for testing, add them to the `test` section under
|
|
92
|
+
`[project.optional-dependencies]`.
|
|
93
|
+
|
|
94
|
+
Any changes to the dependencies will be automatically reflected in
|
|
95
|
+
`requirements.txt` with `pre-commit`, but you can re-generate the file without
|
|
96
|
+
committing by executing:
|
|
97
|
+
|
|
98
|
+
```shell
|
|
99
|
+
pre-commit run pip-compile --all-files
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Project
|
|
103
|
+
|
|
104
|
+
[Hatch](https://hatch.pypa.io/) is used for project management. The project can be built using:
|
|
105
|
+
|
|
106
|
+
```shell
|
|
107
|
+
hatch build
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Linting and syntax checking can be run with:
|
|
111
|
+
|
|
112
|
+
```shell
|
|
113
|
+
hatch fmt --check
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Tests can be executed using:
|
|
117
|
+
|
|
118
|
+
```shell
|
|
119
|
+
hatch test
|
|
120
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
-
astdoc==1.1
|
|
5
|
+
astdoc==1.2.1
|
|
6
6
|
# via mkapi
|
|
7
7
|
attrs==25.3.0
|
|
8
8
|
# via
|
|
@@ -14,13 +14,13 @@ babel==2.17.0
|
|
|
14
14
|
# via mkdocs-material
|
|
15
15
|
backrefs==5.8
|
|
16
16
|
# via mkdocs-material
|
|
17
|
-
certifi==2025.
|
|
17
|
+
certifi==2025.4.26
|
|
18
18
|
# via requests
|
|
19
19
|
cfgv==3.4.0
|
|
20
20
|
# via pre-commit
|
|
21
21
|
chardet==5.2.0
|
|
22
22
|
# via frictionless
|
|
23
|
-
charset-normalizer==3.4.
|
|
23
|
+
charset-normalizer==3.4.2
|
|
24
24
|
# via requests
|
|
25
25
|
click==8.1.8
|
|
26
26
|
# via
|
|
@@ -28,23 +28,25 @@ click==8.1.8
|
|
|
28
28
|
# typer
|
|
29
29
|
colorama==0.4.6
|
|
30
30
|
# via mkdocs-material
|
|
31
|
-
coverage==7.
|
|
31
|
+
coverage==7.8.0
|
|
32
32
|
# via pytest-cov
|
|
33
|
+
cydifflib==1.2.0
|
|
34
|
+
# via hdx-python-utilities
|
|
33
35
|
distlib==0.3.9
|
|
34
36
|
# via virtualenv
|
|
35
37
|
et-xmlfile==2.0.0
|
|
36
38
|
# via openpyxl
|
|
37
39
|
filelock==3.18.0
|
|
38
40
|
# via virtualenv
|
|
39
|
-
frictionless==5.18.
|
|
41
|
+
frictionless==5.18.1
|
|
40
42
|
# via hdx-python-utilities
|
|
41
43
|
ghp-import==2.1.0
|
|
42
44
|
# via mkdocs
|
|
43
|
-
hdx-python-utilities==3.8.
|
|
45
|
+
hdx-python-utilities==3.8.6
|
|
44
46
|
# via hdx-python-country (pyproject.toml)
|
|
45
|
-
humanize==4.12.
|
|
47
|
+
humanize==4.12.3
|
|
46
48
|
# via frictionless
|
|
47
|
-
identify==2.6.
|
|
49
|
+
identify==2.6.10
|
|
48
50
|
# via pre-commit
|
|
49
51
|
idna==3.10
|
|
50
52
|
# via requests
|
|
@@ -68,21 +70,20 @@ jsonschema==4.23.0
|
|
|
68
70
|
# via
|
|
69
71
|
# frictionless
|
|
70
72
|
# tableschema-to-template
|
|
71
|
-
jsonschema-specifications==
|
|
73
|
+
jsonschema-specifications==2025.4.1
|
|
72
74
|
# via jsonschema
|
|
73
75
|
libhxl==5.2.2
|
|
74
76
|
# via hdx-python-country (pyproject.toml)
|
|
75
77
|
loguru==0.7.3
|
|
76
78
|
# via hdx-python-utilities
|
|
77
|
-
markdown==3.
|
|
79
|
+
markdown==3.8
|
|
78
80
|
# via
|
|
79
|
-
# astdoc
|
|
80
81
|
# mkdocs
|
|
81
82
|
# mkdocs-material
|
|
82
83
|
# pymdown-extensions
|
|
83
84
|
markdown-it-py==3.0.0
|
|
84
85
|
# via rich
|
|
85
|
-
marko==2.1.
|
|
86
|
+
marko==2.1.3
|
|
86
87
|
# via frictionless
|
|
87
88
|
markupsafe==3.0.2
|
|
88
89
|
# via
|
|
@@ -94,7 +95,7 @@ mergedeep==1.3.4
|
|
|
94
95
|
# via
|
|
95
96
|
# mkdocs
|
|
96
97
|
# mkdocs-get-deps
|
|
97
|
-
mkapi==4.
|
|
98
|
+
mkapi==4.3.2
|
|
98
99
|
# via hdx-python-country (pyproject.toml)
|
|
99
100
|
mkdocs==1.6.1
|
|
100
101
|
# via
|
|
@@ -102,7 +103,7 @@ mkdocs==1.6.1
|
|
|
102
103
|
# mkdocs-material
|
|
103
104
|
mkdocs-get-deps==0.2.0
|
|
104
105
|
# via mkdocs
|
|
105
|
-
mkdocs-material==9.6.
|
|
106
|
+
mkdocs-material==9.6.12
|
|
106
107
|
# via mkapi
|
|
107
108
|
mkdocs-material-extensions==1.3.1
|
|
108
109
|
# via mkdocs-material
|
|
@@ -110,7 +111,7 @@ nodeenv==1.9.1
|
|
|
110
111
|
# via pre-commit
|
|
111
112
|
openpyxl==3.1.5
|
|
112
113
|
# via hdx-python-utilities
|
|
113
|
-
packaging==
|
|
114
|
+
packaging==25.0
|
|
114
115
|
# via
|
|
115
116
|
# mkdocs
|
|
116
117
|
# pytest
|
|
@@ -118,7 +119,7 @@ paginate==0.5.7
|
|
|
118
119
|
# via mkdocs-material
|
|
119
120
|
pathspec==0.12.1
|
|
120
121
|
# via mkdocs
|
|
121
|
-
petl==1.7.
|
|
122
|
+
petl==1.7.16
|
|
122
123
|
# via frictionless
|
|
123
124
|
platformdirs==4.3.7
|
|
124
125
|
# via
|
|
@@ -132,15 +133,15 @@ ply==3.11
|
|
|
132
133
|
# libhxl
|
|
133
134
|
pre-commit==4.2.0
|
|
134
135
|
# via hdx-python-country (pyproject.toml)
|
|
135
|
-
pydantic==2.
|
|
136
|
+
pydantic==2.11.4
|
|
136
137
|
# via frictionless
|
|
137
|
-
pydantic-core==2.
|
|
138
|
+
pydantic-core==2.33.2
|
|
138
139
|
# via pydantic
|
|
139
140
|
pygments==2.19.1
|
|
140
141
|
# via
|
|
141
142
|
# mkdocs-material
|
|
142
143
|
# rich
|
|
143
|
-
pymdown-extensions==10.
|
|
144
|
+
pymdown-extensions==10.15
|
|
144
145
|
# via mkdocs-material
|
|
145
146
|
pyphonetics==0.5.3
|
|
146
147
|
# via hdx-python-utilities
|
|
@@ -148,7 +149,7 @@ pytest==8.3.5
|
|
|
148
149
|
# via
|
|
149
150
|
# hdx-python-country (pyproject.toml)
|
|
150
151
|
# pytest-cov
|
|
151
|
-
pytest-cov==6.
|
|
152
|
+
pytest-cov==6.1.1
|
|
152
153
|
# via hdx-python-country (pyproject.toml)
|
|
153
154
|
python-dateutil==2.9.0.post0
|
|
154
155
|
# via
|
|
@@ -187,11 +188,9 @@ requests-file==2.1.0
|
|
|
187
188
|
# via hdx-python-utilities
|
|
188
189
|
rfc3986==2.0.0
|
|
189
190
|
# via frictionless
|
|
190
|
-
rich==
|
|
191
|
-
# via
|
|
192
|
-
|
|
193
|
-
# typer
|
|
194
|
-
rpds-py==0.23.1
|
|
191
|
+
rich==14.0.0
|
|
192
|
+
# via typer
|
|
193
|
+
rpds-py==0.24.0
|
|
195
194
|
# via
|
|
196
195
|
# jsonschema
|
|
197
196
|
# referencing
|
|
@@ -205,38 +204,39 @@ simpleeval==1.0.3
|
|
|
205
204
|
# via frictionless
|
|
206
205
|
six==1.17.0
|
|
207
206
|
# via python-dateutil
|
|
208
|
-
|
|
209
|
-
# via frictionless
|
|
210
|
-
structlog==25.2.0
|
|
207
|
+
structlog==25.3.0
|
|
211
208
|
# via libhxl
|
|
212
209
|
tableschema-to-template==0.0.13
|
|
213
210
|
# via hdx-python-utilities
|
|
214
211
|
tabulate==0.9.0
|
|
215
212
|
# via frictionless
|
|
216
|
-
tenacity==9.
|
|
213
|
+
tenacity==9.1.2
|
|
217
214
|
# via hdx-python-country (pyproject.toml)
|
|
218
215
|
text-unidecode==1.3
|
|
219
216
|
# via python-slugify
|
|
220
|
-
typer==0.15.
|
|
217
|
+
typer==0.15.3
|
|
221
218
|
# via frictionless
|
|
222
|
-
typing-extensions==4.
|
|
219
|
+
typing-extensions==4.13.2
|
|
223
220
|
# via
|
|
224
221
|
# frictionless
|
|
225
222
|
# pydantic
|
|
226
223
|
# pydantic-core
|
|
227
224
|
# referencing
|
|
228
225
|
# typer
|
|
229
|
-
|
|
226
|
+
# typing-inspection
|
|
227
|
+
typing-inspection==0.4.0
|
|
228
|
+
# via pydantic
|
|
229
|
+
unidecode==1.4.0
|
|
230
230
|
# via
|
|
231
231
|
# libhxl
|
|
232
232
|
# pyphonetics
|
|
233
|
-
urllib3==2.
|
|
233
|
+
urllib3==2.4.0
|
|
234
234
|
# via
|
|
235
235
|
# libhxl
|
|
236
236
|
# requests
|
|
237
|
-
validators==0.
|
|
237
|
+
validators==0.35.0
|
|
238
238
|
# via frictionless
|
|
239
|
-
virtualenv==20.
|
|
239
|
+
virtualenv==20.31.1
|
|
240
240
|
# via pre-commit
|
|
241
241
|
watchdog==6.0.0
|
|
242
242
|
# via mkdocs
|
|
@@ -248,7 +248,7 @@ xlrd3==1.1.0
|
|
|
248
248
|
# via libhxl
|
|
249
249
|
xlsx2csv==0.8.4
|
|
250
250
|
# via hdx-python-utilities
|
|
251
|
-
xlsxwriter==3.2.
|
|
251
|
+
xlsxwriter==3.2.3
|
|
252
252
|
# via tableschema-to-template
|
|
253
253
|
xlwt==1.3.0
|
|
254
254
|
# via hdx-python-utilities
|
|
@@ -709,7 +709,7 @@ class Country:
|
|
|
709
709
|
for simplification2 in simplifications:
|
|
710
710
|
remove.append(simplification2)
|
|
711
711
|
remove = "|".join(remove)
|
|
712
|
-
regex = re.compile(r"\b(" + remove + r")\b", flags=re.IGNORECASE)
|
|
712
|
+
regex = re.compile(r"[^\w\s]|\b(" + remove + r")\b", flags=re.IGNORECASE)
|
|
713
713
|
countryupper = regex.sub("", countryupper)
|
|
714
714
|
countryupper = countryupper.strip()
|
|
715
715
|
countryupper_words = get_words_in_sentence(countryupper)
|
|
@@ -528,6 +528,14 @@ class TestCountry:
|
|
|
528
528
|
assert Country.simplify_countryname(
|
|
529
529
|
"Democratic People's Republic of Korea"
|
|
530
530
|
) == ("KOREA", ["DEMOCRATIC", "PEOPLE'S", "REPUBLIC", "OF"])
|
|
531
|
+
assert Country.simplify_countryname("Korea (the Republic of))") == (
|
|
532
|
+
"KOREA",
|
|
533
|
+
["THE", "REPUBLIC", "OF"],
|
|
534
|
+
)
|
|
535
|
+
assert Country.simplify_countryname("Korea (the Republic of") == (
|
|
536
|
+
"KOREA",
|
|
537
|
+
["THE", "REPUBLIC", "OF"],
|
|
538
|
+
)
|
|
531
539
|
assert Country.simplify_countryname(
|
|
532
540
|
"The former Yugoslav Republic of Macedonia"
|
|
533
541
|
) == ("MACEDONIA", ["THE", "FORMER", "YUGOSLAV", "REPUBLIC", "OF"])
|
|
@@ -106,8 +106,16 @@ class TestCurrency:
|
|
|
106
106
|
Currency._rates_api = None
|
|
107
107
|
with pytest.raises(CurrencyError):
|
|
108
108
|
Currency.get_current_rate("gbp")
|
|
109
|
-
Currency._rates_api = Currency._primary_rates_url
|
|
110
109
|
assert Currency.get_current_rate("usd") == 1
|
|
110
|
+
|
|
111
|
+
Currency._cached_current_rates = {}
|
|
112
|
+
Currency._cached_historic_rates = {}
|
|
113
|
+
Currency._rates_api = ""
|
|
114
|
+
Currency._secondary_rates = {}
|
|
115
|
+
Currency._secondary_historic_rates = {}
|
|
116
|
+
Currency._fallback_to_current = False
|
|
117
|
+
Currency._no_historic = False
|
|
118
|
+
Currency.setup(no_historic=True)
|
|
111
119
|
rate1gbp = Currency.get_current_rate("gbp")
|
|
112
120
|
assert rate1gbp != 1
|
|
113
121
|
rate1xdr = Currency.get_current_rate("xdr")
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Development
|
|
2
|
-
|
|
3
|
-
## Environment
|
|
4
|
-
|
|
5
|
-
Development is currently done using Python 3.12. We recommend using a virtual
|
|
6
|
-
environment such as ``venv``:
|
|
7
|
-
|
|
8
|
-
python3.12 -m venv venv
|
|
9
|
-
source venv/bin/activate
|
|
10
|
-
|
|
11
|
-
In your virtual environment, please install all packages for
|
|
12
|
-
development by running:
|
|
13
|
-
|
|
14
|
-
pip install -r requirements.txt
|
|
15
|
-
|
|
16
|
-
## Pre-Commit
|
|
17
|
-
|
|
18
|
-
Also be sure to install `pre-commit`, which is run every time
|
|
19
|
-
you make a git commit:
|
|
20
|
-
|
|
21
|
-
pre-commit install
|
|
22
|
-
|
|
23
|
-
With pre-commit, all code is formatted according to
|
|
24
|
-
[ruff](https://github.com/astral-sh/ruff) guidelines.
|
|
25
|
-
|
|
26
|
-
To check if your changes pass pre-commit without committing, run:
|
|
27
|
-
|
|
28
|
-
pre-commit run --all-files
|
|
29
|
-
|
|
30
|
-
## Testing
|
|
31
|
-
|
|
32
|
-
To run the tests and view coverage, execute:
|
|
33
|
-
|
|
34
|
-
pytest --cov hdx
|
|
35
|
-
|
|
36
|
-
Follow the example set out already in ``documentation/main.md`` as you write the documentation.
|
|
37
|
-
|
|
38
|
-
## Packages
|
|
39
|
-
|
|
40
|
-
[pip-tools](https://github.com/jazzband/pip-tools) is used for
|
|
41
|
-
package management. If you’ve introduced a new package to the
|
|
42
|
-
source code (i.e.anywhere in `src/`), please add it to the
|
|
43
|
-
`project.dependencies` section of
|
|
44
|
-
`pyproject.toml` with any known version constraints.
|
|
45
|
-
|
|
46
|
-
For adding packages for testing or development, add them to
|
|
47
|
-
the `test` or `dev` sections under `[project.optional-dependencies]`.
|
|
48
|
-
|
|
49
|
-
Any changes to the dependencies will be automatically reflected in
|
|
50
|
-
`requirements.txt` with `pre-commit`, but you can re-generate
|
|
51
|
-
the file without committing by executing:
|
|
52
|
-
|
|
53
|
-
pre-commit run pip-compile --all-files
|
|
File without changes
|
{hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/.github/workflows/run-python-tests.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/secondary_historic_rates.csv
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_List_1.json
RENAMED
|
File without changes
|
{hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/fixtures/wfp/Currency_List_2.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/Countries_UZB_Deleted.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_country-3.9.2 → hdx_python_country-3.9.3}/tests/hdx/location/test_wfp_exchangerates.py
RENAMED
|
File without changes
|