hdx-python-api 6.5.6__tar.gz → 6.6.0__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.5.6 → hdx_python_api-6.6.0}/.pre-commit-config.yaml +5 -4
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/PKG-INFO +4 -4
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/documentation/index.md +10 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/hatch.toml +1 -1
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/pyproject.toml +3 -3
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/requirements.txt +15 -138
- hdx_python_api-6.6.0/ruff.toml +10 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/_version.py +2 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/configuration.py +39 -39
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/locations.py +27 -28
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/utilities/dataset_title_helper.py +16 -17
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/utilities/date_helper.py +24 -25
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/utilities/filestore_helper.py +18 -21
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/utilities/hdx_error_handler.py +42 -41
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/utilities/hdx_state.py +11 -9
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/dataset.py +461 -472
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/hdxobject.py +142 -141
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/organization.py +46 -46
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/resource.py +104 -113
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/resource_matcher.py +13 -14
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/resource_view.py +26 -25
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/showcase.py +66 -65
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/user.py +79 -79
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/vocabulary.py +111 -120
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/facades/infer_arguments.py +8 -7
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/facades/keyword_arguments.py +6 -4
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/facades/simple.py +6 -4
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/__init__.py +4 -7
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/test_locations.py +2 -1
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/utilities/test_hdx_state.py +8 -11
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_dataset_add_hapi_error.py +4 -5
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_dataset_core.py +29 -47
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_dataset_noncore.py +13 -15
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_organization.py +12 -18
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_resource.py +25 -41
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_resource_view.py +8 -12
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_showcase.py +14 -22
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_update_dataset_resources.py +3 -3
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_user.py +17 -29
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_vocabulary.py +12 -20
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/facades/__init__.py +4 -6
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/facades/test_infer_arguments.py +3 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/facades/test_keyword_arguments.py +3 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/facades/test_simple.py +3 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/workingexample/run.py +2 -1
- hdx_python_api-6.5.6/ruff.toml +0 -15
- hdx_python_api-6.5.6/src/hdx/api/utilities/size_hash.py +0 -43
- hdx_python_api-6.5.6/tests/hdx/api/utilities/test_size_hash.py +0 -12
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/.coveragerc +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/.github/workflows/publish.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/.github/workflows/run-python-tests.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/.gitignore +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/CONTRIBUTING.md +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/LICENSE +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/README.md +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/documentation/mkdocs.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/pytest.ini +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/hdx_base_configuration.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/remotehdx.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/api/utilities/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/data/indicator_resource_view_template.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/src/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/Accepted_Tags.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/CKAN/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/Tag_Mapping.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/Tag_Mapping_ChainRuleError.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/empty.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_base_config.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_base_config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_config.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_dataset_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_datasource_topline.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_email_configuration.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_email_configuration.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_missing_site_config.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_organization_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_organization_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_resource_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_resource_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_resource_view_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_resource_view_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_showcase_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_showcase_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_user_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_user_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_vocabulary_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/hdx_vocabulary_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/project_configuration.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/project_configuration.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/user_agent_config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/user_agent_config2.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/user_agent_config3.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/config/user_agent_config_wrong.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/dataset_search_results.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/download_gen_resource/conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/download_gen_resource/min_qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/download_gen_resource/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/download_gen_resource/test_data_no_data.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/download_gen_resource/test_data_no_years.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/empty.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/gen_resource/conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/gen_resource/min_qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/gen_resource/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/gen_resource/test_data_no_data.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/gen_resource/test_data_no_years.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/organization_show_results.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/qc_from_rows/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/qc_from_rows/qc_conflict_data_alg_one_col.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/resource_formats.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/showcase_all_search_results.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/size_hash/ACLED-All-Africa-File_20170101-to-20170708.xlsx +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/state/analysis_dates.txt +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/state/last_build_date.txt +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/test_data.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/test_data.zip +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/dem_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/dem_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/expected_resources_to_update.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/opri_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/opri_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/opri_metadata_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/qc_sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/sdg_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/sdg_metadata_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/unesco_dataset.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_dataset_resources/unesco_update_dataset.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_logic/update_logic_resources.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/fixtures/update_logic/update_logic_resources_new.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/test_ckan.py +2 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/test_configuration.py +2 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/utilities/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/utilities/test_dataset_title_helper.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/utilities/test_filestore_helper.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/api/utilities/test_hdx_error_handler.py +1 -1
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/conftest.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_dataset_resource_generation.py +3 -3
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/tests/hdx/data/test_update_logic.py +4 -4
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/workingexample/my_code.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/workingexample/my_resource.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.6.0}/workingexample/my_resource.xlsx +0 -0
|
@@ -2,13 +2,13 @@ default_language_version:
|
|
|
2
2
|
python: python3.13
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev:
|
|
5
|
+
rev: v6.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: trailing-whitespace
|
|
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.
|
|
11
|
+
rev: v0.14.10
|
|
12
12
|
hooks:
|
|
13
13
|
# Run the linter.
|
|
14
14
|
- id: ruff-check
|
|
@@ -16,10 +16,11 @@ repos:
|
|
|
16
16
|
# Run the formatter.
|
|
17
17
|
- id: ruff-format
|
|
18
18
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
19
|
-
rev: 0.
|
|
19
|
+
rev: 0.9.22
|
|
20
20
|
hooks:
|
|
21
21
|
# Run the pip compile
|
|
22
22
|
- id: pip-compile
|
|
23
23
|
name: pip-compile requirements.txt
|
|
24
24
|
files: pyproject.toml
|
|
25
|
-
args: [ pyproject.toml, --resolver=backtracking, --
|
|
25
|
+
args: [ pyproject.toml, --resolver=backtracking, --upgrade, -q,
|
|
26
|
+
-o, requirements.txt ]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hdx-python-api
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.6.0
|
|
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
|
|
@@ -24,12 +24,12 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.11
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
26
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
-
Requires-Python: >=3.
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
28
|
Requires-Dist: ckanapi>=4.8
|
|
29
29
|
Requires-Dist: defopt>=7.0.0
|
|
30
30
|
Requires-Dist: email-validator
|
|
31
|
-
Requires-Dist: hdx-python-country>=
|
|
32
|
-
Requires-Dist: hdx-python-utilities>=
|
|
31
|
+
Requires-Dist: hdx-python-country>=4.0.0
|
|
32
|
+
Requires-Dist: hdx-python-utilities>=4.0.0
|
|
33
33
|
Requires-Dist: libhxl>=5.2.2
|
|
34
34
|
Requires-Dist: makefun
|
|
35
35
|
Requires-Dist: quantulum3
|
|
@@ -54,6 +54,10 @@ The library has detailed API documentation which can be found in the menu at the
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
## Breaking Changes
|
|
57
|
+
From 6.6.0, Python 3.10 or later is required
|
|
58
|
+
|
|
59
|
+
From 6.5.7, get_size_and_hash moved to HDX Python Utilities
|
|
60
|
+
|
|
57
61
|
From 6.5.2, remove unused `generate_qc_resource_from_rows` method.
|
|
58
62
|
`generate_resource_from_rows`, `generate_resource_from_iterable` and
|
|
59
63
|
`download_and_generate_resource` are deprecated. They are replaced by
|
|
@@ -906,6 +910,12 @@ corresponding id and that resource on HDX will be overwritten.
|
|
|
906
910
|
|
|
907
911
|
resource.create_in_hdx(dataset=DATASET)
|
|
908
912
|
|
|
913
|
+
Alternatively, if a resource doesn't have an id, but contains a package_id, the create
|
|
914
|
+
and update methods will use it to load the corresponding dataset, the resource will be
|
|
915
|
+
assigned to that dataset and it will be compared to resources in that dataset. If a
|
|
916
|
+
match is found, then the resource will be given the corresponding id and that resource
|
|
917
|
+
on HDX will be overwritten.
|
|
918
|
+
|
|
909
919
|
You can download a resource using the **download** function eg.
|
|
910
920
|
|
|
911
921
|
url, path = resource.download("FOLDER_TO_DOWNLOAD_TO")
|
|
@@ -31,14 +31,14 @@ classifiers = [
|
|
|
31
31
|
"Operating System :: MacOS",
|
|
32
32
|
"Operating System :: Microsoft :: Windows",
|
|
33
33
|
]
|
|
34
|
-
requires-python = ">=3.
|
|
34
|
+
requires-python = ">=3.10"
|
|
35
35
|
|
|
36
36
|
dependencies = [
|
|
37
37
|
"ckanapi>=4.8",
|
|
38
38
|
"defopt>=7.0.0",
|
|
39
39
|
"email_validator",
|
|
40
|
-
"hdx-python-country>=
|
|
41
|
-
"hdx-python-utilities>=
|
|
40
|
+
"hdx-python-country>=4.0.0",
|
|
41
|
+
"hdx-python-utilities>=4.0.0",
|
|
42
42
|
"libhxl>=5.2.2",
|
|
43
43
|
"makefun",
|
|
44
44
|
"quantulum3",
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
# This file was autogenerated by uv via the following command:
|
|
2
|
-
# uv pip compile pyproject.toml --resolver=backtracking
|
|
2
|
+
# uv pip compile pyproject.toml --resolver=backtracking -o requirements.txt
|
|
3
3
|
annotated-types==0.7.0
|
|
4
4
|
# via pydantic
|
|
5
|
-
astdoc==1.3.2
|
|
6
|
-
# via mkapi
|
|
7
5
|
attrs==25.4.0
|
|
8
6
|
# via
|
|
9
7
|
# frictionless
|
|
10
8
|
# jsonlines
|
|
11
9
|
# jsonschema
|
|
12
10
|
# referencing
|
|
13
|
-
|
|
14
|
-
# via mkdocs-material
|
|
15
|
-
backrefs==6.1
|
|
16
|
-
# via mkdocs-material
|
|
17
|
-
cachetools==6.2.4
|
|
18
|
-
# via google-auth
|
|
19
|
-
certifi==2025.11.12
|
|
11
|
+
certifi==2026.1.4
|
|
20
12
|
# via requests
|
|
21
|
-
cfgv==3.5.0
|
|
22
|
-
# via pre-commit
|
|
23
13
|
chardet==5.2.0
|
|
24
14
|
# via frictionless
|
|
25
15
|
charset-normalizer==3.4.4
|
|
@@ -27,53 +17,31 @@ charset-normalizer==3.4.4
|
|
|
27
17
|
ckanapi==4.9
|
|
28
18
|
# via hdx-python-api (pyproject.toml)
|
|
29
19
|
click==8.3.1
|
|
30
|
-
# via
|
|
31
|
-
# mkdocs
|
|
32
|
-
# typer
|
|
33
|
-
colorama==0.4.6
|
|
34
|
-
# via mkdocs-material
|
|
35
|
-
coverage==7.13.0
|
|
36
|
-
# via pytest-cov
|
|
20
|
+
# via typer
|
|
37
21
|
defopt==7.0.0
|
|
38
22
|
# via hdx-python-api (pyproject.toml)
|
|
39
|
-
distlib==0.4.0
|
|
40
|
-
# via virtualenv
|
|
41
23
|
dnspython==2.8.0
|
|
42
24
|
# via email-validator
|
|
43
25
|
docopt==0.6.2
|
|
44
26
|
# via
|
|
45
27
|
# ckanapi
|
|
46
28
|
# num2words
|
|
47
|
-
docutils==0.22.
|
|
29
|
+
docutils==0.22.4
|
|
48
30
|
# via defopt
|
|
49
31
|
email-validator==2.3.0
|
|
50
32
|
# via hdx-python-api (pyproject.toml)
|
|
51
33
|
et-xmlfile==2.0.0
|
|
52
34
|
# via openpyxl
|
|
53
|
-
filelock==3.20.1
|
|
54
|
-
# via virtualenv
|
|
55
35
|
frictionless==5.18.1
|
|
56
36
|
# via hdx-python-utilities
|
|
57
|
-
|
|
58
|
-
# via mkdocs
|
|
59
|
-
google-auth==2.45.0
|
|
60
|
-
# via
|
|
61
|
-
# google-auth-oauthlib
|
|
62
|
-
# gspread
|
|
63
|
-
google-auth-oauthlib==1.2.2
|
|
64
|
-
# via gspread
|
|
65
|
-
gspread==6.2.1
|
|
66
|
-
# via hdx-python-api (pyproject.toml)
|
|
67
|
-
hdx-python-country==3.9.8
|
|
37
|
+
hdx-python-country==4.0.0
|
|
68
38
|
# via hdx-python-api (pyproject.toml)
|
|
69
|
-
hdx-python-utilities==
|
|
39
|
+
hdx-python-utilities==4.0.0
|
|
70
40
|
# via
|
|
71
41
|
# hdx-python-api (pyproject.toml)
|
|
72
42
|
# hdx-python-country
|
|
73
|
-
humanize==4.
|
|
43
|
+
humanize==4.15.0
|
|
74
44
|
# via frictionless
|
|
75
|
-
identify==2.6.15
|
|
76
|
-
# via pre-commit
|
|
77
45
|
idna==3.11
|
|
78
46
|
# via
|
|
79
47
|
# email-validator
|
|
@@ -82,21 +50,15 @@ ijson==3.4.0.post0
|
|
|
82
50
|
# via hdx-python-utilities
|
|
83
51
|
inflect==7.5.0
|
|
84
52
|
# via quantulum3
|
|
85
|
-
iniconfig==2.3.0
|
|
86
|
-
# via pytest
|
|
87
53
|
isodate==0.7.2
|
|
88
54
|
# via frictionless
|
|
89
55
|
jinja2==3.1.6
|
|
90
|
-
# via
|
|
91
|
-
# frictionless
|
|
92
|
-
# mkapi
|
|
93
|
-
# mkdocs
|
|
94
|
-
# mkdocs-material
|
|
56
|
+
# via frictionless
|
|
95
57
|
jsonlines==4.0.0
|
|
96
58
|
# via hdx-python-utilities
|
|
97
59
|
jsonpath-ng==1.7.0
|
|
98
60
|
# via libhxl
|
|
99
|
-
jsonschema==4.
|
|
61
|
+
jsonschema==4.26.0
|
|
100
62
|
# via
|
|
101
63
|
# frictionless
|
|
102
64
|
# tableschema-to-template
|
|
@@ -110,105 +72,39 @@ loguru==0.7.3
|
|
|
110
72
|
# via hdx-python-utilities
|
|
111
73
|
makefun==1.16.0
|
|
112
74
|
# via hdx-python-api (pyproject.toml)
|
|
113
|
-
markdown==3.10
|
|
114
|
-
# via
|
|
115
|
-
# mkdocs
|
|
116
|
-
# mkdocs-material
|
|
117
|
-
# pymdown-extensions
|
|
118
75
|
markdown-it-py==4.0.0
|
|
119
76
|
# via rich
|
|
120
|
-
marko==2.2.
|
|
77
|
+
marko==2.2.2
|
|
121
78
|
# via frictionless
|
|
122
79
|
markupsafe==3.0.3
|
|
123
|
-
# via
|
|
124
|
-
# jinja2
|
|
125
|
-
# mkdocs
|
|
80
|
+
# via jinja2
|
|
126
81
|
mdurl==0.1.2
|
|
127
82
|
# via markdown-it-py
|
|
128
|
-
mergedeep==1.3.4
|
|
129
|
-
# via
|
|
130
|
-
# mkdocs
|
|
131
|
-
# mkdocs-get-deps
|
|
132
|
-
mkapi==4.5.0
|
|
133
|
-
# via hdx-python-api (pyproject.toml)
|
|
134
|
-
mkdocs==1.6.1
|
|
135
|
-
# via
|
|
136
|
-
# mkapi
|
|
137
|
-
# mkdocs-material
|
|
138
|
-
mkdocs-get-deps==0.2.0
|
|
139
|
-
# via mkdocs
|
|
140
|
-
mkdocs-material==9.7.0
|
|
141
|
-
# via mkapi
|
|
142
|
-
mkdocs-material-extensions==1.3.1
|
|
143
|
-
# via mkdocs-material
|
|
144
83
|
more-itertools==10.8.0
|
|
145
84
|
# via inflect
|
|
146
|
-
nodeenv==1.9.1
|
|
147
|
-
# via pre-commit
|
|
148
85
|
num2words==0.5.14
|
|
149
86
|
# via quantulum3
|
|
150
|
-
oauthlib==3.3.1
|
|
151
|
-
# via requests-oauthlib
|
|
152
87
|
openpyxl==3.1.5
|
|
153
88
|
# via hdx-python-utilities
|
|
154
|
-
packaging==25.0
|
|
155
|
-
# via
|
|
156
|
-
# mkdocs
|
|
157
|
-
# pytest
|
|
158
|
-
paginate==0.5.7
|
|
159
|
-
# via mkdocs-material
|
|
160
|
-
pathspec==0.12.1
|
|
161
|
-
# via mkdocs
|
|
162
89
|
petl==1.7.17
|
|
163
90
|
# via frictionless
|
|
164
|
-
platformdirs==4.5.1
|
|
165
|
-
# via
|
|
166
|
-
# mkdocs-get-deps
|
|
167
|
-
# virtualenv
|
|
168
|
-
pluggy==1.6.0
|
|
169
|
-
# via
|
|
170
|
-
# pytest
|
|
171
|
-
# pytest-cov
|
|
172
91
|
ply==3.11
|
|
173
92
|
# via
|
|
174
93
|
# jsonpath-ng
|
|
175
94
|
# libhxl
|
|
176
95
|
pockets==0.9.1
|
|
177
96
|
# via sphinxcontrib-napoleon
|
|
178
|
-
pre-commit==4.5.1
|
|
179
|
-
# via hdx-python-api (pyproject.toml)
|
|
180
|
-
pyasn1==0.6.1
|
|
181
|
-
# via
|
|
182
|
-
# pyasn1-modules
|
|
183
|
-
# rsa
|
|
184
|
-
pyasn1-modules==0.4.2
|
|
185
|
-
# via google-auth
|
|
186
97
|
pydantic==2.12.5
|
|
187
98
|
# via frictionless
|
|
188
99
|
pydantic-core==2.41.5
|
|
189
100
|
# via pydantic
|
|
190
101
|
pygments==2.19.2
|
|
191
|
-
# via
|
|
192
|
-
# mkdocs-material
|
|
193
|
-
# pytest
|
|
194
|
-
# rich
|
|
195
|
-
pymdown-extensions==10.19.1
|
|
196
|
-
# via mkdocs-material
|
|
102
|
+
# via rich
|
|
197
103
|
pyphonetics==0.5.3
|
|
198
104
|
# via hdx-python-utilities
|
|
199
|
-
pytest==9.0.2
|
|
200
|
-
# via
|
|
201
|
-
# hdx-python-api (pyproject.toml)
|
|
202
|
-
# pytest-check
|
|
203
|
-
# pytest-cov
|
|
204
|
-
pytest-check==2.6.2
|
|
205
|
-
# via hdx-python-api (pyproject.toml)
|
|
206
|
-
pytest-cov==7.0.0
|
|
207
|
-
# via hdx-python-api (pyproject.toml)
|
|
208
105
|
python-dateutil==2.9.0.post0
|
|
209
106
|
# via
|
|
210
107
|
# frictionless
|
|
211
|
-
# ghp-import
|
|
212
108
|
# hdx-python-utilities
|
|
213
109
|
# libhxl
|
|
214
110
|
python-io-wrapper==0.3.1
|
|
@@ -220,14 +116,7 @@ python-slugify==8.0.4
|
|
|
220
116
|
pyyaml==6.0.3
|
|
221
117
|
# via
|
|
222
118
|
# frictionless
|
|
223
|
-
# mkdocs
|
|
224
|
-
# mkdocs-get-deps
|
|
225
|
-
# pre-commit
|
|
226
|
-
# pymdown-extensions
|
|
227
|
-
# pyyaml-env-tag
|
|
228
119
|
# tableschema-to-template
|
|
229
|
-
pyyaml-env-tag==1.1
|
|
230
|
-
# via mkdocs
|
|
231
120
|
quantulum3==0.9.2
|
|
232
121
|
# via hdx-python-api (pyproject.toml)
|
|
233
122
|
ratelimit==2.2.1
|
|
@@ -242,13 +131,9 @@ requests==2.32.5
|
|
|
242
131
|
# ckanapi
|
|
243
132
|
# frictionless
|
|
244
133
|
# libhxl
|
|
245
|
-
# mkdocs-material
|
|
246
134
|
# requests-file
|
|
247
|
-
# requests-oauthlib
|
|
248
135
|
requests-file==3.0.1
|
|
249
136
|
# via hdx-python-utilities
|
|
250
|
-
requests-oauthlib==2.0.0
|
|
251
|
-
# via google-auth-oauthlib
|
|
252
137
|
rfc3986==2.0.0
|
|
253
138
|
# via frictionless
|
|
254
139
|
rich==14.2.0
|
|
@@ -257,12 +142,8 @@ rpds-py==0.30.0
|
|
|
257
142
|
# via
|
|
258
143
|
# jsonschema
|
|
259
144
|
# referencing
|
|
260
|
-
|
|
261
|
-
# via google-auth
|
|
262
|
-
ruamel-yaml==0.18.17
|
|
145
|
+
ruamel-yaml==0.19.1
|
|
263
146
|
# via hdx-python-utilities
|
|
264
|
-
ruamel-yaml-clib==0.2.15
|
|
265
|
-
# via ruamel-yaml
|
|
266
147
|
setuptools==80.9.0
|
|
267
148
|
# via ckanapi
|
|
268
149
|
shellingham==1.5.4
|
|
@@ -291,7 +172,7 @@ text-unidecode==1.3
|
|
|
291
172
|
# via python-slugify
|
|
292
173
|
typeguard==4.4.4
|
|
293
174
|
# via inflect
|
|
294
|
-
typer==0.
|
|
175
|
+
typer==0.21.1
|
|
295
176
|
# via frictionless
|
|
296
177
|
typing-extensions==4.15.0
|
|
297
178
|
# via
|
|
@@ -307,16 +188,12 @@ unidecode==1.4.0
|
|
|
307
188
|
# via
|
|
308
189
|
# libhxl
|
|
309
190
|
# pyphonetics
|
|
310
|
-
urllib3==2.6.
|
|
191
|
+
urllib3==2.6.3
|
|
311
192
|
# via
|
|
312
193
|
# libhxl
|
|
313
194
|
# requests
|
|
314
195
|
validators==0.35.0
|
|
315
196
|
# via frictionless
|
|
316
|
-
virtualenv==20.35.4
|
|
317
|
-
# via pre-commit
|
|
318
|
-
watchdog==6.0.0
|
|
319
|
-
# via mkdocs
|
|
320
197
|
wheel==0.45.1
|
|
321
198
|
# via libhxl
|
|
322
199
|
xlrd==2.0.2
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '6.
|
|
32
|
-
__version_tuple__ = version_tuple = (6,
|
|
31
|
+
__version__ = version = '6.6.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (6, 6, 0)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -5,12 +5,10 @@ import os
|
|
|
5
5
|
from base64 import b64decode
|
|
6
6
|
from collections import UserDict
|
|
7
7
|
from os.path import expanduser, isfile, join
|
|
8
|
-
from typing import Any,
|
|
8
|
+
from typing import Any, Optional
|
|
9
9
|
|
|
10
10
|
import ckanapi
|
|
11
11
|
import requests
|
|
12
|
-
|
|
13
|
-
from hdx.api import __version__
|
|
14
12
|
from hdx.utilities.dictandlist import merge_two_dictionaries
|
|
15
13
|
from hdx.utilities.email import Email
|
|
16
14
|
from hdx.utilities.loader import load_json, load_yaml
|
|
@@ -18,6 +16,8 @@ from hdx.utilities.path import script_dir_plus_file
|
|
|
18
16
|
from hdx.utilities.session import get_session
|
|
19
17
|
from hdx.utilities.useragent import UserAgent, UserAgentError
|
|
20
18
|
|
|
19
|
+
from hdx.api import __version__
|
|
20
|
+
|
|
21
21
|
logger = logging.getLogger(__name__)
|
|
22
22
|
|
|
23
23
|
|
|
@@ -229,7 +229,7 @@ class Configuration(UserDict):
|
|
|
229
229
|
Set HDX read only flag
|
|
230
230
|
|
|
231
231
|
Args:
|
|
232
|
-
read_only
|
|
232
|
+
read_only: Value to set HDX read only flag. Defaults to True.
|
|
233
233
|
Returns:
|
|
234
234
|
None
|
|
235
235
|
|
|
@@ -241,19 +241,19 @@ class Configuration(UserDict):
|
|
|
241
241
|
Set HDX api key
|
|
242
242
|
|
|
243
243
|
Args:
|
|
244
|
-
apikey
|
|
244
|
+
apikey: Value to set api key.
|
|
245
245
|
Returns:
|
|
246
246
|
None
|
|
247
247
|
|
|
248
248
|
"""
|
|
249
249
|
self.hdx_key = apikey
|
|
250
250
|
|
|
251
|
-
def get_api_key(self) ->
|
|
251
|
+
def get_api_key(self) -> str | None:
|
|
252
252
|
"""
|
|
253
253
|
Return HDX api key or None if read only
|
|
254
254
|
|
|
255
255
|
Returns:
|
|
256
|
-
|
|
256
|
+
HDX api key or None if read only
|
|
257
257
|
|
|
258
258
|
"""
|
|
259
259
|
if self.hdx_read_only:
|
|
@@ -265,7 +265,7 @@ class Configuration(UserDict):
|
|
|
265
265
|
Return user agent
|
|
266
266
|
|
|
267
267
|
Returns:
|
|
268
|
-
|
|
268
|
+
User agent
|
|
269
269
|
|
|
270
270
|
"""
|
|
271
271
|
return self.user_agent
|
|
@@ -275,7 +275,7 @@ class Configuration(UserDict):
|
|
|
275
275
|
Return HDX web site url
|
|
276
276
|
|
|
277
277
|
Returns:
|
|
278
|
-
|
|
278
|
+
HDX web site url
|
|
279
279
|
|
|
280
280
|
"""
|
|
281
281
|
return self.data[self.hdx_site]["url"]
|
|
@@ -288,17 +288,17 @@ class Configuration(UserDict):
|
|
|
288
288
|
name: Dataset name
|
|
289
289
|
|
|
290
290
|
Returns:
|
|
291
|
-
|
|
291
|
+
HDX dataset url
|
|
292
292
|
|
|
293
293
|
"""
|
|
294
294
|
return f"{self.get_hdx_site_url()}/dataset/{name}"
|
|
295
295
|
|
|
296
|
-
def _get_credentials(self) ->
|
|
296
|
+
def _get_credentials(self) -> tuple[str, str] | None:
|
|
297
297
|
"""
|
|
298
298
|
Return HDX site username and password
|
|
299
299
|
|
|
300
300
|
Returns:
|
|
301
|
-
|
|
301
|
+
HDX site username and password or None
|
|
302
302
|
|
|
303
303
|
"""
|
|
304
304
|
site = self.data[self.hdx_site]
|
|
@@ -315,7 +315,7 @@ class Configuration(UserDict):
|
|
|
315
315
|
Return the session object
|
|
316
316
|
|
|
317
317
|
Returns:
|
|
318
|
-
|
|
318
|
+
The session object
|
|
319
319
|
|
|
320
320
|
"""
|
|
321
321
|
if self._session is None:
|
|
@@ -329,7 +329,7 @@ class Configuration(UserDict):
|
|
|
329
329
|
Return the remote CKAN object (see ckanapi library)
|
|
330
330
|
|
|
331
331
|
Returns:
|
|
332
|
-
|
|
332
|
+
The remote CKAN object
|
|
333
333
|
|
|
334
334
|
"""
|
|
335
335
|
if self._remoteckan is None:
|
|
@@ -338,7 +338,7 @@ class Configuration(UserDict):
|
|
|
338
338
|
)
|
|
339
339
|
return self._remoteckan
|
|
340
340
|
|
|
341
|
-
def call_remoteckan(self, *args: Any, **kwargs: Any) ->
|
|
341
|
+
def call_remoteckan(self, *args: Any, **kwargs: Any) -> dict:
|
|
342
342
|
"""
|
|
343
343
|
Calls the remote CKAN
|
|
344
344
|
|
|
@@ -347,7 +347,7 @@ class Configuration(UserDict):
|
|
|
347
347
|
**kwargs: Keyword arguments to pass to remote CKAN call_action method
|
|
348
348
|
|
|
349
349
|
Returns:
|
|
350
|
-
|
|
350
|
+
The response from the remote CKAN call_action method
|
|
351
351
|
|
|
352
352
|
"""
|
|
353
353
|
requests_kwargs = kwargs.get("requests_kwargs", {})
|
|
@@ -363,24 +363,24 @@ class Configuration(UserDict):
|
|
|
363
363
|
def create_session_user_agent(
|
|
364
364
|
cls,
|
|
365
365
|
session: requests.Session = None,
|
|
366
|
-
user_agent:
|
|
367
|
-
user_agent_config_yaml:
|
|
368
|
-
user_agent_lookup:
|
|
366
|
+
user_agent: str | None = None,
|
|
367
|
+
user_agent_config_yaml: str | None = None,
|
|
368
|
+
user_agent_lookup: str | None = None,
|
|
369
369
|
use_env: bool = False,
|
|
370
370
|
**kwargs: Any,
|
|
371
|
-
) ->
|
|
371
|
+
) -> tuple[requests.Session, str]:
|
|
372
372
|
"""
|
|
373
373
|
Create session and user agent from configuration
|
|
374
374
|
|
|
375
375
|
Args:
|
|
376
|
-
session
|
|
377
|
-
user_agent
|
|
378
|
-
user_agent_config_yaml
|
|
379
|
-
user_agent_lookup
|
|
380
|
-
use_env
|
|
376
|
+
session: requests Session object to use. Defaults to calling hdx.utilities.session.get_session()
|
|
377
|
+
user_agent: User agent string. HDXPythonLibrary/X.X.X- is prefixed.
|
|
378
|
+
user_agent_config_yaml: Path to YAML user agent configuration. Ignored if user_agent supplied. Defaults to ~/.useragent.yaml.
|
|
379
|
+
user_agent_lookup: Lookup key for YAML. Ignored if user_agent supplied.
|
|
380
|
+
use_env: Whether to read environment variables. Defaults to False.
|
|
381
381
|
|
|
382
382
|
Returns:
|
|
383
|
-
Tuple
|
|
383
|
+
Tuple of (session, user agent)
|
|
384
384
|
|
|
385
385
|
"""
|
|
386
386
|
if not session:
|
|
@@ -416,13 +416,13 @@ class Configuration(UserDict):
|
|
|
416
416
|
return session, ua
|
|
417
417
|
|
|
418
418
|
def setup_session_remoteckan(
|
|
419
|
-
self, remoteckan:
|
|
419
|
+
self, remoteckan: ckanapi.RemoteCKAN | None = None, **kwargs: Any
|
|
420
420
|
) -> None:
|
|
421
421
|
"""
|
|
422
422
|
Set up remote CKAN from provided CKAN or by creating from configuration
|
|
423
423
|
|
|
424
424
|
Args:
|
|
425
|
-
remoteckan
|
|
425
|
+
remoteckan: CKAN instance. Defaults to setting one up from configuration.
|
|
426
426
|
|
|
427
427
|
Returns:
|
|
428
428
|
None
|
|
@@ -445,7 +445,7 @@ class Configuration(UserDict):
|
|
|
445
445
|
Return the Email object (see :any:`Email`)
|
|
446
446
|
|
|
447
447
|
Returns:
|
|
448
|
-
|
|
448
|
+
The email object
|
|
449
449
|
|
|
450
450
|
"""
|
|
451
451
|
if self._emailer is None:
|
|
@@ -482,7 +482,7 @@ class Configuration(UserDict):
|
|
|
482
482
|
Read the HDX configuration
|
|
483
483
|
|
|
484
484
|
Returns:
|
|
485
|
-
|
|
485
|
+
The HDX configuration
|
|
486
486
|
|
|
487
487
|
"""
|
|
488
488
|
if cls._configuration is None:
|
|
@@ -499,7 +499,7 @@ class Configuration(UserDict):
|
|
|
499
499
|
Construct the HDX configuration
|
|
500
500
|
|
|
501
501
|
Args:
|
|
502
|
-
configuration
|
|
502
|
+
configuration: Configuration instance. Defaults to setting one up from passed arguments.
|
|
503
503
|
**kwargs: See below
|
|
504
504
|
user_agent (str): User agent string. HDXPythonLibrary/X.X.X- is prefixed. Must be supplied if remoteckan is not.
|
|
505
505
|
user_agent_config_yaml (str): Path to YAML user agent configuration. Ignored if user_agent supplied. Defaults to ~/.useragent.yaml.
|
|
@@ -531,15 +531,15 @@ class Configuration(UserDict):
|
|
|
531
531
|
def _create(
|
|
532
532
|
cls,
|
|
533
533
|
configuration: Optional["Configuration"] = None,
|
|
534
|
-
remoteckan:
|
|
534
|
+
remoteckan: ckanapi.RemoteCKAN | None = None,
|
|
535
535
|
**kwargs: Any,
|
|
536
536
|
) -> str:
|
|
537
537
|
"""
|
|
538
538
|
Create HDX configuration
|
|
539
539
|
|
|
540
540
|
Args:
|
|
541
|
-
configuration
|
|
542
|
-
remoteckan
|
|
541
|
+
configuration: Configuration instance. Defaults to setting one up from passed arguments.
|
|
542
|
+
remoteckan: CKAN instance. Defaults to setting one up from configuration.
|
|
543
543
|
**kwargs: See below
|
|
544
544
|
user_agent (str): User agent string. HDXPythonLibrary/X.X.X- is prefixed. Must be supplied if remoteckan is not.
|
|
545
545
|
user_agent_config_yaml (str): Path to YAML user agent configuration. Ignored if user_agent supplied. Defaults to ~/.useragent.yaml.
|
|
@@ -559,7 +559,7 @@ class Configuration(UserDict):
|
|
|
559
559
|
hdx_base_config_yaml (str): Path to YAML HDX base configuration. Defaults to library's internal hdx_base_configuration.yaml.
|
|
560
560
|
|
|
561
561
|
Returns:
|
|
562
|
-
|
|
562
|
+
HDX site url
|
|
563
563
|
|
|
564
564
|
"""
|
|
565
565
|
cls.setup(configuration, **kwargs)
|
|
@@ -570,15 +570,15 @@ class Configuration(UserDict):
|
|
|
570
570
|
def create(
|
|
571
571
|
cls,
|
|
572
572
|
configuration: Optional["Configuration"] = None,
|
|
573
|
-
remoteckan:
|
|
573
|
+
remoteckan: ckanapi.RemoteCKAN | None = None,
|
|
574
574
|
**kwargs: Any,
|
|
575
575
|
) -> str:
|
|
576
576
|
"""
|
|
577
577
|
Create HDX configuration. Can only be called once (will raise an error if called more than once).
|
|
578
578
|
|
|
579
579
|
Args:
|
|
580
|
-
configuration
|
|
581
|
-
remoteckan
|
|
580
|
+
configuration: Configuration instance. Defaults to setting one up from passed arguments.
|
|
581
|
+
remoteckan: CKAN instance. Defaults to setting one up from configuration.
|
|
582
582
|
**kwargs: See below
|
|
583
583
|
user_agent (str): User agent string. HDXPythonLibrary/X.X.X- is prefixed. Must be supplied if remoteckan is not.
|
|
584
584
|
user_agent_config_yaml (str): Path to YAML user agent configuration. Ignored if user_agent supplied. Defaults to ~/.useragent.yaml.
|
|
@@ -598,7 +598,7 @@ class Configuration(UserDict):
|
|
|
598
598
|
hdx_base_config_yaml (str): Path to YAML HDX base configuration. Defaults to library's internal hdx_base_configuration.yaml.
|
|
599
599
|
|
|
600
600
|
Returns:
|
|
601
|
-
|
|
601
|
+
HDX site url
|
|
602
602
|
|
|
603
603
|
"""
|
|
604
604
|
if cls._configuration is not None:
|