hdx-python-api 6.3.0__tar.gz → 6.3.2__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_api-6.3.0 → hdx_python_api-6.3.2}/.config/pre-commit-config.yaml +4 -5
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/.github/workflows/run-python-tests.yaml +8 -3
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/PKG-INFO +3 -3
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/pyproject.toml +13 -17
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/requirements.txt +57 -38
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/api/_version.py +2 -2
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/dataset.py +15 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/user.py +15 -5
- hdx_python_api-6.3.2/tests/fixtures/Accepted_Tags.csv +140 -0
- hdx_python_api-6.3.2/tests/fixtures/Tag_Mapping.csv +5150 -0
- hdx_python_api-6.3.2/tests/fixtures/config/project_configuration.yaml +5 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/api/test_configuration.py +12 -12
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/__init__.py +7 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_dataset_core.py +9 -2
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_dataset_noncore.py +97 -72
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_showcase.py +13 -8
- hdx_python_api-6.3.2/tests/hdx/data/test_vocabulary.py +1536 -0
- hdx_python_api-6.3.0/tests/fixtures/Accepted_Tags.csv +0 -365
- hdx_python_api-6.3.0/tests/fixtures/Tag_Mapping.csv +0 -4844
- hdx_python_api-6.3.0/tests/fixtures/config/project_configuration.yaml +0 -5
- hdx_python_api-6.3.0/tests/hdx/data/test_vocabulary.py +0 -2693
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/.config/coveragerc +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/.config/pytest.ini +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/.config/ruff.toml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/.github/workflows/publish.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/.gitignore +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/CONTRIBUTING.md +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/LICENSE +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/README.md +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/documentation/main.md +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/documentation/pydoc-markdown.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/api/configuration.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/api/hdx_base_configuration.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/api/locations.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/api/remotehdx.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/dataset_title_helper.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/date_helper.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/filestore_helper.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/hdxobject.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/indicator_resource_view_template.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/organization.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/resource.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/resource_matcher.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/resource_view.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/showcase.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/data/vocabulary.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/facades/infer_arguments.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/facades/keyword_arguments.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/src/hdx/facades/simple.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/CKAN/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/Tag_Mapping_ChainRuleError.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/empty.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_base_config.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_base_config.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_config.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_config.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_dataset_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_datasource_topline.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_email_configuration.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_email_configuration.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_missing_site_config.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_organization_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_organization_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_resource_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_resource_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_resource_view_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_resource_view_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_showcase_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_showcase_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_user_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_user_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_vocabulary_static.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/hdx_vocabulary_static.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/project_configuration.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/user_agent_config.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/user_agent_config2.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/user_agent_config3.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/config/user_agent_config_wrong.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/dataset_search_results.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/datastore/ACLED-All-Africa-File_20170101-to-20170708.xlsx +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/empty.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/gen_resource/conflict_data_alg.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/gen_resource/min_qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/gen_resource/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/gen_resource/test_data_no_data.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/gen_resource/test_data_no_years.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/organization_show_results.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/qc_from_rows/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/qc_from_rows/qc_conflict_data_alg_one_col.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/resource_formats.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/showcase_all_search_results.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/test_data.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/test_data.zip +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/dem_data_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/dem_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/expected_resources_to_update.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/opri_data_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/opri_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/opri_metadata_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/qc_sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/sdg_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/sdg_metadata_zwe.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/unesco_dataset.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_dataset_resources/unesco_update_dataset.json +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_logic/update_logic_resources.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/fixtures/update_logic/update_logic_resources_new.yaml +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/api/test_ckan.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/api/test_locations.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/conftest.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_dataset_title_helper.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_filestore_helper.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_organization.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_resource.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_resource_view.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_update_dataset_resources.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_update_logic.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/data/test_user.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/facades/test_infer_arguments.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/facades/test_keyword_arguments.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/tests/hdx/facades/test_simple.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/workingexample/my_code.py +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/workingexample/my_resource.csv +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/workingexample/my_resource.xlsx +0 -0
- {hdx_python_api-6.3.0 → hdx_python_api-6.3.2}/workingexample/run.py +0 -0
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
default_language_version:
|
|
2
|
-
python: python3.
|
|
2
|
+
python: python3.12
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev: v4.
|
|
5
|
+
rev: v4.6.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: trailing-whitespace
|
|
8
8
|
- id: end-of-file-fixer
|
|
9
|
-
exclude: test_scraper_.*\.json
|
|
10
9
|
- id: check-ast
|
|
11
10
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
12
|
-
rev: v0.
|
|
11
|
+
rev: v0.5.1
|
|
13
12
|
hooks:
|
|
14
13
|
# Run the linter.
|
|
15
14
|
- id: ruff
|
|
@@ -18,7 +17,7 @@ repos:
|
|
|
18
17
|
- id: ruff-format
|
|
19
18
|
args: [--config, .config/ruff.toml]
|
|
20
19
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
21
|
-
rev: 0.
|
|
20
|
+
rev: 0.2.13
|
|
22
21
|
hooks:
|
|
23
22
|
# Run the pip compile
|
|
24
23
|
- id: pip-compile
|
|
@@ -13,6 +13,10 @@ on:
|
|
|
13
13
|
branches-ignore:
|
|
14
14
|
- gh-pages
|
|
15
15
|
|
|
16
|
+
concurrency:
|
|
17
|
+
group: ${{ github.head_ref || github.ref_name }}
|
|
18
|
+
|
|
19
|
+
|
|
16
20
|
jobs:
|
|
17
21
|
build:
|
|
18
22
|
runs-on: ubuntu-latest
|
|
@@ -26,17 +30,18 @@ jobs:
|
|
|
26
30
|
- name: Install dependencies
|
|
27
31
|
run: |
|
|
28
32
|
python -m pip install --upgrade pip
|
|
29
|
-
|
|
33
|
+
- name: Install Hatch
|
|
34
|
+
uses: pypa/hatch@install
|
|
30
35
|
- name: Test with hatch/pytest
|
|
31
36
|
env:
|
|
32
37
|
HDX_KEY_TEST: ${{ secrets.HDX_BOT_SCRAPERS_API_TOKEN }}
|
|
33
38
|
GSHEET_AUTH: ${{ secrets.GSHEET_AUTH }}
|
|
34
39
|
run: |
|
|
35
|
-
hatch
|
|
40
|
+
hatch test
|
|
36
41
|
- name: Check styling
|
|
37
42
|
if: always()
|
|
38
43
|
run: |
|
|
39
|
-
hatch
|
|
44
|
+
hatch fmt --check
|
|
40
45
|
- name: Publish Unit Test Results
|
|
41
46
|
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
42
47
|
if: always()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: hdx-python-api
|
|
3
|
-
Version: 6.3.
|
|
3
|
+
Version: 6.3.2
|
|
4
4
|
Summary: HDX Python API for interacting with the Humanitarian Data Exchange
|
|
5
5
|
Project-URL: Homepage, https://github.com/OCHA-DAP/hdx-python-api
|
|
6
6
|
Author: Michael Rans
|
|
@@ -28,8 +28,8 @@ Requires-Python: >=3.8
|
|
|
28
28
|
Requires-Dist: ckanapi>=4.8
|
|
29
29
|
Requires-Dist: defopt>=6.4.0
|
|
30
30
|
Requires-Dist: email-validator
|
|
31
|
-
Requires-Dist: hdx-python-country>=3.7.
|
|
32
|
-
Requires-Dist: hdx-python-utilities>=3.
|
|
31
|
+
Requires-Dist: hdx-python-country>=3.7.7
|
|
32
|
+
Requires-Dist: hdx-python-utilities>=3.7.2
|
|
33
33
|
Requires-Dist: libhxl>=5.2.1
|
|
34
34
|
Requires-Dist: makefun
|
|
35
35
|
Requires-Dist: ndg-httpsclient
|
|
@@ -37,8 +37,8 @@ dependencies = [
|
|
|
37
37
|
"ckanapi>=4.8",
|
|
38
38
|
"defopt>=6.4.0",
|
|
39
39
|
"email_validator",
|
|
40
|
-
"hdx-python-country>=3.7.
|
|
41
|
-
"hdx-python-utilities>=3.
|
|
40
|
+
"hdx-python-country>=3.7.7",
|
|
41
|
+
"hdx-python-utilities>=3.7.2",
|
|
42
42
|
"libhxl>=5.2.1",
|
|
43
43
|
"makefun",
|
|
44
44
|
"ndg-httpsclient",
|
|
@@ -84,25 +84,21 @@ version_scheme = "python-simplified-semver"
|
|
|
84
84
|
|
|
85
85
|
# Tests
|
|
86
86
|
|
|
87
|
-
[tool.hatch.envs.test]
|
|
87
|
+
[tool.hatch.envs.hatch-test]
|
|
88
88
|
features = ["test"]
|
|
89
89
|
|
|
90
|
-
[tool.hatch.envs.test.
|
|
91
|
-
|
|
90
|
+
[[tool.hatch.envs.hatch-test.matrix]]
|
|
91
|
+
python = ["3.12"]
|
|
92
|
+
|
|
93
|
+
[tool.hatch.envs.hatch-test.scripts]
|
|
94
|
+
run = """
|
|
92
95
|
pytest -c .config/pytest.ini --rootdir=. --junitxml=test-results.xml \
|
|
93
96
|
--cov --cov-config=.config/coveragerc --no-cov-on-fail \
|
|
94
97
|
--cov-report=lcov --cov-report=term-missing
|
|
95
98
|
"""
|
|
96
99
|
|
|
97
|
-
[
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[
|
|
101
|
-
|
|
102
|
-
dependencies = ["ruff"]
|
|
103
|
-
|
|
104
|
-
[tool.hatch.envs.lint.scripts]
|
|
105
|
-
style = [
|
|
106
|
-
"ruff check --config .config/ruff.toml --diff {args:.}",
|
|
107
|
-
"ruff format --config .config/ruff.toml --diff {args:.}",
|
|
108
|
-
]
|
|
100
|
+
[tool.hatch.envs.hatch-static-analysis.scripts]
|
|
101
|
+
format-check = ["ruff format --config .config/ruff.toml --check --diff {args:.}",]
|
|
102
|
+
format-fix = ["ruff format --config .config/ruff.toml {args:.}",]
|
|
103
|
+
lint-check = ["ruff check --config .config/ruff.toml {args:.}",]
|
|
104
|
+
lint-fix = ["ruff check --config .config/ruff.toml --fix {args:.}",]
|
|
@@ -8,9 +8,9 @@ attrs==23.2.0
|
|
|
8
8
|
# jsonlines
|
|
9
9
|
# jsonschema
|
|
10
10
|
# referencing
|
|
11
|
-
cachetools==5.
|
|
11
|
+
cachetools==5.4.0
|
|
12
12
|
# via google-auth
|
|
13
|
-
certifi==2024.
|
|
13
|
+
certifi==2024.7.4
|
|
14
14
|
# via requests
|
|
15
15
|
cffi==1.16.0
|
|
16
16
|
# via cryptography
|
|
@@ -21,13 +21,15 @@ chardet==5.2.0
|
|
|
21
21
|
charset-normalizer==3.3.2
|
|
22
22
|
# via requests
|
|
23
23
|
ckanapi==4.8
|
|
24
|
+
# via hdx-python-api (pyproject.toml)
|
|
24
25
|
click==8.1.7
|
|
25
26
|
# via typer
|
|
26
|
-
coverage==7.
|
|
27
|
+
coverage==7.6.0
|
|
27
28
|
# via pytest-cov
|
|
28
|
-
cryptography==
|
|
29
|
+
cryptography==43.0.0
|
|
29
30
|
# via pyopenssl
|
|
30
31
|
defopt==6.4.0
|
|
32
|
+
# via hdx-python-api (pyproject.toml)
|
|
31
33
|
distlib==0.3.8
|
|
32
34
|
# via virtualenv
|
|
33
35
|
dnspython==2.6.1
|
|
@@ -38,34 +40,39 @@ docopt==0.6.2
|
|
|
38
40
|
# num2words
|
|
39
41
|
docutils==0.21.2
|
|
40
42
|
# via defopt
|
|
41
|
-
email-validator==2.
|
|
43
|
+
email-validator==2.2.0
|
|
44
|
+
# via hdx-python-api (pyproject.toml)
|
|
42
45
|
et-xmlfile==1.1.0
|
|
43
46
|
# via openpyxl
|
|
44
|
-
filelock==3.
|
|
47
|
+
filelock==3.15.4
|
|
45
48
|
# via virtualenv
|
|
46
49
|
frictionless==5.17.0
|
|
47
50
|
# via hdx-python-utilities
|
|
48
|
-
google-auth==2.
|
|
51
|
+
google-auth==2.32.0
|
|
49
52
|
# via
|
|
50
53
|
# google-auth-oauthlib
|
|
51
54
|
# gspread
|
|
52
|
-
google-auth-oauthlib==1.2.
|
|
55
|
+
google-auth-oauthlib==1.2.1
|
|
53
56
|
# via gspread
|
|
54
57
|
gspread==6.1.2
|
|
55
|
-
hdx-python-
|
|
56
|
-
hdx-python-
|
|
57
|
-
# via hdx-python-
|
|
58
|
-
|
|
58
|
+
# via hdx-python-api (pyproject.toml)
|
|
59
|
+
hdx-python-country==3.7.7
|
|
60
|
+
# via hdx-python-api (pyproject.toml)
|
|
61
|
+
hdx-python-utilities==3.7.2
|
|
62
|
+
# via
|
|
63
|
+
# hdx-python-api (pyproject.toml)
|
|
64
|
+
# hdx-python-country
|
|
65
|
+
humanize==4.10.0
|
|
59
66
|
# via frictionless
|
|
60
|
-
identify==2.
|
|
67
|
+
identify==2.6.0
|
|
61
68
|
# via pre-commit
|
|
62
69
|
idna==3.7
|
|
63
70
|
# via
|
|
64
71
|
# email-validator
|
|
65
72
|
# requests
|
|
66
|
-
ijson==3.
|
|
73
|
+
ijson==3.3.0
|
|
67
74
|
# via hdx-python-utilities
|
|
68
|
-
inflect==7.
|
|
75
|
+
inflect==7.3.1
|
|
69
76
|
# via quantulum3
|
|
70
77
|
iniconfig==2.0.0
|
|
71
78
|
# via pytest
|
|
@@ -77,37 +84,41 @@ jsonlines==4.0.0
|
|
|
77
84
|
# via hdx-python-utilities
|
|
78
85
|
jsonpath-ng==1.6.1
|
|
79
86
|
# via libhxl
|
|
80
|
-
jsonschema==4.
|
|
87
|
+
jsonschema==4.23.0
|
|
81
88
|
# via
|
|
82
89
|
# frictionless
|
|
83
90
|
# tableschema-to-template
|
|
84
91
|
jsonschema-specifications==2023.12.1
|
|
85
92
|
# via jsonschema
|
|
86
93
|
libhxl==5.2.1
|
|
87
|
-
# via
|
|
94
|
+
# via
|
|
95
|
+
# hdx-python-api (pyproject.toml)
|
|
96
|
+
# hdx-python-country
|
|
88
97
|
loguru==0.7.2
|
|
89
98
|
# via hdx-python-utilities
|
|
90
|
-
makefun==1.15.
|
|
99
|
+
makefun==1.15.4
|
|
100
|
+
# via hdx-python-api (pyproject.toml)
|
|
91
101
|
markdown-it-py==3.0.0
|
|
92
102
|
# via rich
|
|
93
|
-
marko==2.
|
|
103
|
+
marko==2.1.2
|
|
94
104
|
# via frictionless
|
|
95
105
|
markupsafe==2.1.5
|
|
96
106
|
# via jinja2
|
|
97
107
|
mdurl==0.1.2
|
|
98
108
|
# via markdown-it-py
|
|
99
|
-
more-itertools==10.
|
|
109
|
+
more-itertools==10.3.0
|
|
100
110
|
# via inflect
|
|
101
111
|
ndg-httpsclient==0.5.1
|
|
112
|
+
# via hdx-python-api (pyproject.toml)
|
|
102
113
|
nodeenv==1.9.1
|
|
103
114
|
# via pre-commit
|
|
104
115
|
num2words==0.5.13
|
|
105
116
|
# via quantulum3
|
|
106
117
|
oauthlib==3.2.2
|
|
107
118
|
# via requests-oauthlib
|
|
108
|
-
openpyxl==3.1.
|
|
119
|
+
openpyxl==3.1.5
|
|
109
120
|
# via hdx-python-utilities
|
|
110
|
-
packaging==24.
|
|
121
|
+
packaging==24.1
|
|
111
122
|
# via pytest
|
|
112
123
|
petl==1.7.15
|
|
113
124
|
# via frictionless
|
|
@@ -122,8 +133,10 @@ ply==3.11
|
|
|
122
133
|
pockets==0.9.1
|
|
123
134
|
# via sphinxcontrib-napoleon
|
|
124
135
|
pre-commit==3.7.1
|
|
136
|
+
# via hdx-python-api (pyproject.toml)
|
|
125
137
|
pyasn1==0.6.0
|
|
126
138
|
# via
|
|
139
|
+
# hdx-python-api (pyproject.toml)
|
|
127
140
|
# ndg-httpsclient
|
|
128
141
|
# pyasn1-modules
|
|
129
142
|
# rsa
|
|
@@ -131,20 +144,25 @@ pyasn1-modules==0.4.0
|
|
|
131
144
|
# via google-auth
|
|
132
145
|
pycparser==2.22
|
|
133
146
|
# via cffi
|
|
134
|
-
pydantic==2.
|
|
147
|
+
pydantic==2.8.2
|
|
135
148
|
# via frictionless
|
|
136
|
-
pydantic-core==2.
|
|
149
|
+
pydantic-core==2.20.1
|
|
137
150
|
# via pydantic
|
|
138
151
|
pygments==2.18.0
|
|
139
152
|
# via rich
|
|
140
|
-
pyopenssl==24.1
|
|
141
|
-
# via
|
|
153
|
+
pyopenssl==24.2.1
|
|
154
|
+
# via
|
|
155
|
+
# hdx-python-api (pyproject.toml)
|
|
156
|
+
# ndg-httpsclient
|
|
142
157
|
pyphonetics==0.5.3
|
|
143
158
|
# via hdx-python-country
|
|
144
|
-
pytest==8.
|
|
145
|
-
# via
|
|
159
|
+
pytest==8.3.2
|
|
160
|
+
# via
|
|
161
|
+
# hdx-python-api (pyproject.toml)
|
|
162
|
+
# pytest-cov
|
|
146
163
|
pytest-cov==5.0.0
|
|
147
|
-
python-
|
|
164
|
+
# via hdx-python-api (pyproject.toml)
|
|
165
|
+
python-dateutil==2.9.0.post0
|
|
148
166
|
# via
|
|
149
167
|
# frictionless
|
|
150
168
|
# hdx-python-utilities
|
|
@@ -160,7 +178,8 @@ pyyaml==6.0.1
|
|
|
160
178
|
# frictionless
|
|
161
179
|
# pre-commit
|
|
162
180
|
# tableschema-to-template
|
|
163
|
-
quantulum3==0.9.
|
|
181
|
+
quantulum3==0.9.2
|
|
182
|
+
# via hdx-python-api (pyproject.toml)
|
|
164
183
|
ratelimit==2.2.1
|
|
165
184
|
# via hdx-python-utilities
|
|
166
185
|
referencing==0.35.1
|
|
@@ -169,6 +188,7 @@ referencing==0.35.1
|
|
|
169
188
|
# jsonschema-specifications
|
|
170
189
|
requests==2.32.3
|
|
171
190
|
# via
|
|
191
|
+
# hdx-python-api (pyproject.toml)
|
|
172
192
|
# ckanapi
|
|
173
193
|
# frictionless
|
|
174
194
|
# libhxl
|
|
@@ -182,7 +202,7 @@ rfc3986==2.0.0
|
|
|
182
202
|
# via frictionless
|
|
183
203
|
rich==13.7.1
|
|
184
204
|
# via typer
|
|
185
|
-
rpds-py==0.
|
|
205
|
+
rpds-py==0.19.1
|
|
186
206
|
# via
|
|
187
207
|
# jsonschema
|
|
188
208
|
# referencing
|
|
@@ -192,7 +212,7 @@ ruamel-yaml==0.18.6
|
|
|
192
212
|
# via hdx-python-utilities
|
|
193
213
|
ruamel-yaml-clib==0.2.8
|
|
194
214
|
# via ruamel-yaml
|
|
195
|
-
setuptools==
|
|
215
|
+
setuptools==71.1.0
|
|
196
216
|
# via ckanapi
|
|
197
217
|
shellingham==1.5.4
|
|
198
218
|
# via typer
|
|
@@ -211,7 +231,7 @@ sphinxcontrib-napoleon==0.7
|
|
|
211
231
|
# via defopt
|
|
212
232
|
stringcase==1.2.0
|
|
213
233
|
# via frictionless
|
|
214
|
-
structlog==24.
|
|
234
|
+
structlog==24.4.0
|
|
215
235
|
# via libhxl
|
|
216
236
|
tableschema-to-template==0.0.13
|
|
217
237
|
# via hdx-python-utilities
|
|
@@ -223,10 +243,9 @@ typeguard==4.3.0
|
|
|
223
243
|
# via inflect
|
|
224
244
|
typer==0.12.3
|
|
225
245
|
# via frictionless
|
|
226
|
-
typing-extensions==4.12.
|
|
246
|
+
typing-extensions==4.12.2
|
|
227
247
|
# via
|
|
228
248
|
# frictionless
|
|
229
|
-
# inflect
|
|
230
249
|
# pydantic
|
|
231
250
|
# pydantic-core
|
|
232
251
|
# typeguard
|
|
@@ -235,13 +254,13 @@ unidecode==1.3.8
|
|
|
235
254
|
# via
|
|
236
255
|
# libhxl
|
|
237
256
|
# pyphonetics
|
|
238
|
-
urllib3==2.2.
|
|
257
|
+
urllib3==2.2.2
|
|
239
258
|
# via
|
|
240
259
|
# libhxl
|
|
241
260
|
# requests
|
|
242
|
-
validators==0.
|
|
261
|
+
validators==0.33.0
|
|
243
262
|
# via frictionless
|
|
244
|
-
virtualenv==20.26.
|
|
263
|
+
virtualenv==20.26.3
|
|
245
264
|
# via pre-commit
|
|
246
265
|
wheel==0.43.0
|
|
247
266
|
# via libhxl
|
|
@@ -986,6 +986,19 @@ class Dataset(HDXObject):
|
|
|
986
986
|
match_resource_order,
|
|
987
987
|
**kwargs,
|
|
988
988
|
)
|
|
989
|
+
keep_crisis_tags = kwargs.get("keep_crisis_tags", True)
|
|
990
|
+
if keep_crisis_tags:
|
|
991
|
+
for tag in self.data["tags"]:
|
|
992
|
+
tag_name = tag["name"]
|
|
993
|
+
if tag_name[:7] != "crisis-":
|
|
994
|
+
continue
|
|
995
|
+
found = False
|
|
996
|
+
for old_tag in self.old_data["tags"]:
|
|
997
|
+
if old_tag["name"] == tag_name:
|
|
998
|
+
found = True
|
|
999
|
+
break
|
|
1000
|
+
if not found:
|
|
1001
|
+
self.old_data["tags"].append(tag)
|
|
989
1002
|
self._prepare_hdx_call(self.old_data, kwargs)
|
|
990
1003
|
return self._revise_dataset(
|
|
991
1004
|
keys_to_delete,
|
|
@@ -1021,6 +1034,7 @@ class Dataset(HDXObject):
|
|
|
1021
1034
|
create_default_views (bool): Whether to call package_create_default_resource_views. Defaults to True.
|
|
1022
1035
|
hxl_update (bool): Whether to call package_hxl_update. Defaults to True.
|
|
1023
1036
|
**kwargs: See below
|
|
1037
|
+
keep_crisis_tags (bool): Whether to keep existing crisis tags. Defaults to True.
|
|
1024
1038
|
updated_by_script (str): String to identify your script. Defaults to your user agent.
|
|
1025
1039
|
batch (str): A string you can specify to show which datasets are part of a single batch update
|
|
1026
1040
|
|
|
@@ -1077,6 +1091,7 @@ class Dataset(HDXObject):
|
|
|
1077
1091
|
create_default_views (bool): Whether to call package_create_default_resource_views (if updating). Defaults to True.
|
|
1078
1092
|
hxl_update (bool): Whether to call package_hxl_update. Defaults to True.
|
|
1079
1093
|
**kwargs: See below
|
|
1094
|
+
keep_crisis_tags (bool): Whether to keep existing crisis tags. Defaults to True.
|
|
1080
1095
|
updated_by_script (str): String to identify your script. Defaults to your user agent.
|
|
1081
1096
|
batch (str): A string you can specify to show which datasets are part of a single batch update
|
|
1082
1097
|
|
|
@@ -289,16 +289,21 @@ class User(HDXObject):
|
|
|
289
289
|
organizations.append(org)
|
|
290
290
|
return organizations
|
|
291
291
|
|
|
292
|
-
def check_organization_access(
|
|
292
|
+
def check_organization_access(
|
|
293
|
+
self, organization: str, permission: str = "read"
|
|
294
|
+
) -> bool:
|
|
293
295
|
"""Check user is a member of a given organization.
|
|
294
296
|
|
|
295
297
|
Args:
|
|
296
298
|
organization (str): Organization id or name.
|
|
299
|
+
permission (str): Permission to check for. Defaults to 'read'.
|
|
297
300
|
|
|
298
301
|
Returns:
|
|
299
302
|
bool: True if the logged in user is a member of the organization.
|
|
300
303
|
"""
|
|
301
|
-
for organization_dict in self.get_organization_dicts(
|
|
304
|
+
for organization_dict in self.get_organization_dicts(
|
|
305
|
+
permission=permission
|
|
306
|
+
):
|
|
302
307
|
if organization_dict["id"] == organization:
|
|
303
308
|
return True
|
|
304
309
|
if organization_dict["name"] == organization:
|
|
@@ -323,7 +328,7 @@ class User(HDXObject):
|
|
|
323
328
|
user = User(configuration=configuration)
|
|
324
329
|
try:
|
|
325
330
|
return user.configuration.call_remoteckan(
|
|
326
|
-
cls.actions()["listorgs"]
|
|
331
|
+
cls.actions()["listorgs"], {"permission": permission}
|
|
327
332
|
)
|
|
328
333
|
except Exception:
|
|
329
334
|
return []
|
|
@@ -355,16 +360,21 @@ class User(HDXObject):
|
|
|
355
360
|
return organizations
|
|
356
361
|
|
|
357
362
|
@classmethod
|
|
358
|
-
def check_current_user_organization_access(
|
|
363
|
+
def check_current_user_organization_access(
|
|
364
|
+
cls, organization: str, permission: str = "read"
|
|
365
|
+
) -> bool:
|
|
359
366
|
"""Check logged in user is a member of a given organization.
|
|
360
367
|
|
|
361
368
|
Args:
|
|
362
369
|
organization (str): Organization id or name.
|
|
370
|
+
permission (str): Permission to check for. Defaults to 'read'.
|
|
363
371
|
|
|
364
372
|
Returns:
|
|
365
373
|
bool: True if the logged in user is a member of the organization.
|
|
366
374
|
"""
|
|
367
|
-
for organization_dict in cls.get_current_user_organization_dicts(
|
|
375
|
+
for organization_dict in cls.get_current_user_organization_dicts(
|
|
376
|
+
permission=permission
|
|
377
|
+
):
|
|
368
378
|
if organization_dict["id"] == organization:
|
|
369
379
|
return True
|
|
370
380
|
if organization_dict["name"] == organization:
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
administrative boundaries-divisions
|
|
2
|
+
affected area
|
|
3
|
+
affected population
|
|
4
|
+
africa
|
|
5
|
+
agriculture-livestock
|
|
6
|
+
aid effectiveness
|
|
7
|
+
aid worker security
|
|
8
|
+
aid workers
|
|
9
|
+
americas
|
|
10
|
+
asylum seekers
|
|
11
|
+
aviation
|
|
12
|
+
baseline population
|
|
13
|
+
births
|
|
14
|
+
border crossings
|
|
15
|
+
boys
|
|
16
|
+
camp coordination and camp management-cccm
|
|
17
|
+
cash based interventions-cbi
|
|
18
|
+
cash voucher assistance-cva
|
|
19
|
+
casualties
|
|
20
|
+
census
|
|
21
|
+
central africa
|
|
22
|
+
children
|
|
23
|
+
climate hazards
|
|
24
|
+
climate-weather
|
|
25
|
+
cluster system
|
|
26
|
+
community engagement
|
|
27
|
+
complex emergency-conflict-security
|
|
28
|
+
conflict-violence
|
|
29
|
+
covid-19
|
|
30
|
+
cyclones-hurricanes-typhoons
|
|
31
|
+
damage assessment
|
|
32
|
+
demographics
|
|
33
|
+
development
|
|
34
|
+
disability
|
|
35
|
+
disaster risk reduction-drr
|
|
36
|
+
disease
|
|
37
|
+
displacement
|
|
38
|
+
drought
|
|
39
|
+
earthquake-tsunami
|
|
40
|
+
eastern africa
|
|
41
|
+
economics
|
|
42
|
+
education
|
|
43
|
+
education facilities-schools
|
|
44
|
+
el nino-el nina
|
|
45
|
+
elderly
|
|
46
|
+
employment
|
|
47
|
+
energy
|
|
48
|
+
environment
|
|
49
|
+
epidemics-outbreaks
|
|
50
|
+
facilities-infrastructure
|
|
51
|
+
fatalities
|
|
52
|
+
female
|
|
53
|
+
flooding-storm surge
|
|
54
|
+
food security
|
|
55
|
+
forced displacement
|
|
56
|
+
forecasting
|
|
57
|
+
funding
|
|
58
|
+
gazetteer
|
|
59
|
+
gender
|
|
60
|
+
gender-based violence-gbv
|
|
61
|
+
geodata
|
|
62
|
+
girls
|
|
63
|
+
global acute malnutrition-gam
|
|
64
|
+
governance and civil society
|
|
65
|
+
gross domestic product-gdp
|
|
66
|
+
hazards and risk
|
|
67
|
+
health
|
|
68
|
+
health facilities
|
|
69
|
+
horn of africa
|
|
70
|
+
human rights
|
|
71
|
+
humanitarian access
|
|
72
|
+
humanitarian needs overview-hno
|
|
73
|
+
humanitarian response plan-hrp
|
|
74
|
+
hxl
|
|
75
|
+
hydrology
|
|
76
|
+
indicators
|
|
77
|
+
integrated food security phase classification-ipc
|
|
78
|
+
internally displaced persons-idp
|
|
79
|
+
international aid transparency initiative-iati
|
|
80
|
+
languages
|
|
81
|
+
libya-floods
|
|
82
|
+
literacy
|
|
83
|
+
livelihoods
|
|
84
|
+
logistics
|
|
85
|
+
malaria
|
|
86
|
+
malnutrition
|
|
87
|
+
markets
|
|
88
|
+
maternity
|
|
89
|
+
men
|
|
90
|
+
mental health
|
|
91
|
+
migration
|
|
92
|
+
morocco-earthquake
|
|
93
|
+
mortality
|
|
94
|
+
natural disasters
|
|
95
|
+
needs assessment
|
|
96
|
+
non-food items-nfi
|
|
97
|
+
nutrition
|
|
98
|
+
openstreetmap
|
|
99
|
+
operational capacity
|
|
100
|
+
operational partners
|
|
101
|
+
operational presence
|
|
102
|
+
opt-israel-hostilities
|
|
103
|
+
peacekeeping
|
|
104
|
+
people in need-pin
|
|
105
|
+
points of interest-poi
|
|
106
|
+
populated places-settlements
|
|
107
|
+
population
|
|
108
|
+
ports
|
|
109
|
+
poverty
|
|
110
|
+
protection
|
|
111
|
+
railways
|
|
112
|
+
refugee crisis
|
|
113
|
+
refugees
|
|
114
|
+
returnees
|
|
115
|
+
rivers
|
|
116
|
+
roads
|
|
117
|
+
rural
|
|
118
|
+
sahel
|
|
119
|
+
services
|
|
120
|
+
severe acute malnutrition-sam
|
|
121
|
+
severity
|
|
122
|
+
sex and age disaggregated data-sadd
|
|
123
|
+
shelter
|
|
124
|
+
social media data
|
|
125
|
+
socioeconomics
|
|
126
|
+
stateless persons
|
|
127
|
+
survey
|
|
128
|
+
sustainable development
|
|
129
|
+
sustainable development goals-sdg
|
|
130
|
+
topography
|
|
131
|
+
trade
|
|
132
|
+
transportation
|
|
133
|
+
urban
|
|
134
|
+
urban search and rescue-usar
|
|
135
|
+
vaccination-immunization
|
|
136
|
+
water sanitation and hygiene-wash
|
|
137
|
+
west africa
|
|
138
|
+
who is doing what and where-3w-4w-5w
|
|
139
|
+
women
|
|
140
|
+
youth
|