hdx-python-api 6.5.6__tar.gz → 6.5.7__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.5.7}/PKG-INFO +2 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/documentation/index.md +8 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/pyproject.toml +1 -1
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/requirements.txt +13 -15
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/_version.py +2 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/utilities/filestore_helper.py +3 -7
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/resource.py +3 -7
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/__init__.py +1 -1
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_dataset_core.py +2 -2
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_update_dataset_resources.py +1 -1
- 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.5.7}/.coveragerc +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/.github/workflows/publish.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/.github/workflows/run-python-tests.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/.gitignore +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/.pre-commit-config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/CONTRIBUTING.md +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/LICENSE +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/README.md +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/documentation/mkdocs.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/hatch.toml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/pytest.ini +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/ruff.toml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/configuration.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/hdx_base_configuration.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/locations.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/remotehdx.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/utilities/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/utilities/dataset_title_helper.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/utilities/date_helper.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/utilities/hdx_error_handler.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/api/utilities/hdx_state.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/dataset.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/hdxobject.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/indicator_resource_view_template.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/organization.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/resource_matcher.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/resource_view.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/showcase.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/user.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/vocabulary.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/facades/infer_arguments.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/facades/keyword_arguments.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/facades/simple.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/Accepted_Tags.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/CKAN/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/Tag_Mapping.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/Tag_Mapping_ChainRuleError.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/empty.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_base_config.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_base_config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_config.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_dataset_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_datasource_topline.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_email_configuration.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_email_configuration.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_missing_site_config.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_organization_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_organization_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_view_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_view_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_showcase_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_showcase_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_user_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_user_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_vocabulary_static.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_vocabulary_static.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/project_configuration.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/project_configuration.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/user_agent_config.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/user_agent_config2.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/user_agent_config3.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/user_agent_config_wrong.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/dataset_search_results.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/download_gen_resource/conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/download_gen_resource/min_qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/download_gen_resource/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/download_gen_resource/test_data_no_data.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/download_gen_resource/test_data_no_years.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/empty.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/min_qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/test_data_no_data.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/test_data_no_years.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/organization_show_results.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/qc_from_rows/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/qc_from_rows/qc_conflict_data_alg_one_col.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/resource_formats.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/showcase_all_search_results.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/size_hash/ACLED-All-Africa-File_20170101-to-20170708.xlsx +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/state/analysis_dates.txt +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/state/last_build_date.txt +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/test_data.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/test_data.zip +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/dem_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/dem_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/expected_resources_to_update.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/opri_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/opri_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/opri_metadata_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/qc_sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/sdg_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/sdg_metadata_zwe.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/unesco_dataset.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_dataset_resources/unesco_update_dataset.json +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_logic/update_logic_resources.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/update_logic/update_logic_resources_new.yaml +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/test_ckan.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/test_configuration.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/test_locations.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_dataset_title_helper.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_filestore_helper.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_hdx_error_handler.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_hdx_state.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/conftest.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_dataset_add_hapi_error.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_dataset_noncore.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_dataset_resource_generation.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_organization.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_resource.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_resource_view.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_showcase.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_update_logic.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_user.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_vocabulary.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/facades/test_infer_arguments.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/facades/test_keyword_arguments.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/facades/test_simple.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/workingexample/my_code.py +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/workingexample/my_resource.csv +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/workingexample/my_resource.xlsx +0 -0
- {hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/workingexample/run.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hdx-python-api
|
|
3
|
-
Version: 6.5.
|
|
3
|
+
Version: 6.5.7
|
|
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
|
|
@@ -29,7 +29,7 @@ Requires-Dist: ckanapi>=4.8
|
|
|
29
29
|
Requires-Dist: defopt>=7.0.0
|
|
30
30
|
Requires-Dist: email-validator
|
|
31
31
|
Requires-Dist: hdx-python-country>=3.9.8
|
|
32
|
-
Requires-Dist: hdx-python-utilities>=3.9.
|
|
32
|
+
Requires-Dist: hdx-python-utilities>=3.9.9
|
|
33
33
|
Requires-Dist: libhxl>=5.2.2
|
|
34
34
|
Requires-Dist: makefun
|
|
35
35
|
Requires-Dist: quantulum3
|
|
@@ -54,6 +54,8 @@ 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.5.7, get_size_and_hash moved to HDX Python Utilities
|
|
58
|
+
|
|
57
59
|
From 6.5.2, remove unused `generate_qc_resource_from_rows` method.
|
|
58
60
|
`generate_resource_from_rows`, `generate_resource_from_iterable` and
|
|
59
61
|
`download_and_generate_resource` are deprecated. They are replaced by
|
|
@@ -906,6 +908,12 @@ corresponding id and that resource on HDX will be overwritten.
|
|
|
906
908
|
|
|
907
909
|
resource.create_in_hdx(dataset=DATASET)
|
|
908
910
|
|
|
911
|
+
Alternatively, if a resource doesn't have an id, but contains a package_id, the create
|
|
912
|
+
and update methods will use it to load the corresponding dataset, the resource will be
|
|
913
|
+
assigned to that dataset and it will be compared to resources in that dataset. If a
|
|
914
|
+
match is found, then the resource will be given the corresponding id and that resource
|
|
915
|
+
on HDX will be overwritten.
|
|
916
|
+
|
|
909
917
|
You can download a resource using the **download** function eg.
|
|
910
918
|
|
|
911
919
|
url, path = resource.download("FOLDER_TO_DOWNLOAD_TO")
|
|
@@ -16,7 +16,7 @@ backrefs==6.1
|
|
|
16
16
|
# via mkdocs-material
|
|
17
17
|
cachetools==6.2.4
|
|
18
18
|
# via google-auth
|
|
19
|
-
certifi==
|
|
19
|
+
certifi==2026.1.4
|
|
20
20
|
# via requests
|
|
21
21
|
cfgv==3.5.0
|
|
22
22
|
# via pre-commit
|
|
@@ -32,7 +32,7 @@ click==8.3.1
|
|
|
32
32
|
# typer
|
|
33
33
|
colorama==0.4.6
|
|
34
34
|
# via mkdocs-material
|
|
35
|
-
coverage==7.13.
|
|
35
|
+
coverage==7.13.1
|
|
36
36
|
# via pytest-cov
|
|
37
37
|
defopt==7.0.0
|
|
38
38
|
# via hdx-python-api (pyproject.toml)
|
|
@@ -44,19 +44,19 @@ docopt==0.6.2
|
|
|
44
44
|
# via
|
|
45
45
|
# ckanapi
|
|
46
46
|
# num2words
|
|
47
|
-
docutils==0.22.
|
|
47
|
+
docutils==0.22.4
|
|
48
48
|
# via defopt
|
|
49
49
|
email-validator==2.3.0
|
|
50
50
|
# via hdx-python-api (pyproject.toml)
|
|
51
51
|
et-xmlfile==2.0.0
|
|
52
52
|
# via openpyxl
|
|
53
|
-
filelock==3.20.
|
|
53
|
+
filelock==3.20.2
|
|
54
54
|
# via virtualenv
|
|
55
55
|
frictionless==5.18.1
|
|
56
56
|
# via hdx-python-utilities
|
|
57
57
|
ghp-import==2.1.0
|
|
58
58
|
# via mkdocs
|
|
59
|
-
google-auth==2.
|
|
59
|
+
google-auth==2.46.0
|
|
60
60
|
# via
|
|
61
61
|
# google-auth-oauthlib
|
|
62
62
|
# gspread
|
|
@@ -66,11 +66,11 @@ gspread==6.2.1
|
|
|
66
66
|
# via hdx-python-api (pyproject.toml)
|
|
67
67
|
hdx-python-country==3.9.8
|
|
68
68
|
# via hdx-python-api (pyproject.toml)
|
|
69
|
-
hdx-python-utilities==3.9.
|
|
69
|
+
hdx-python-utilities==3.9.9
|
|
70
70
|
# via
|
|
71
71
|
# hdx-python-api (pyproject.toml)
|
|
72
72
|
# hdx-python-country
|
|
73
|
-
humanize==4.
|
|
73
|
+
humanize==4.15.0
|
|
74
74
|
# via frictionless
|
|
75
75
|
identify==2.6.15
|
|
76
76
|
# via pre-commit
|
|
@@ -117,7 +117,7 @@ markdown==3.10
|
|
|
117
117
|
# pymdown-extensions
|
|
118
118
|
markdown-it-py==4.0.0
|
|
119
119
|
# via rich
|
|
120
|
-
marko==2.2.
|
|
120
|
+
marko==2.2.2
|
|
121
121
|
# via frictionless
|
|
122
122
|
markupsafe==3.0.3
|
|
123
123
|
# via
|
|
@@ -137,13 +137,13 @@ mkdocs==1.6.1
|
|
|
137
137
|
# mkdocs-material
|
|
138
138
|
mkdocs-get-deps==0.2.0
|
|
139
139
|
# via mkdocs
|
|
140
|
-
mkdocs-material==9.7.
|
|
140
|
+
mkdocs-material==9.7.1
|
|
141
141
|
# via mkapi
|
|
142
142
|
mkdocs-material-extensions==1.3.1
|
|
143
143
|
# via mkdocs-material
|
|
144
144
|
more-itertools==10.8.0
|
|
145
145
|
# via inflect
|
|
146
|
-
nodeenv==1.
|
|
146
|
+
nodeenv==1.10.0
|
|
147
147
|
# via pre-commit
|
|
148
148
|
num2words==0.5.14
|
|
149
149
|
# via quantulum3
|
|
@@ -192,7 +192,7 @@ pygments==2.19.2
|
|
|
192
192
|
# mkdocs-material
|
|
193
193
|
# pytest
|
|
194
194
|
# rich
|
|
195
|
-
pymdown-extensions==10.
|
|
195
|
+
pymdown-extensions==10.20
|
|
196
196
|
# via mkdocs-material
|
|
197
197
|
pyphonetics==0.5.3
|
|
198
198
|
# via hdx-python-utilities
|
|
@@ -259,10 +259,8 @@ rpds-py==0.30.0
|
|
|
259
259
|
# referencing
|
|
260
260
|
rsa==4.9.1
|
|
261
261
|
# via google-auth
|
|
262
|
-
ruamel-yaml==0.
|
|
262
|
+
ruamel-yaml==0.19.1
|
|
263
263
|
# via hdx-python-utilities
|
|
264
|
-
ruamel-yaml-clib==0.2.15
|
|
265
|
-
# via ruamel-yaml
|
|
266
264
|
setuptools==80.9.0
|
|
267
265
|
# via ckanapi
|
|
268
266
|
shellingham==1.5.4
|
|
@@ -291,7 +289,7 @@ text-unidecode==1.3
|
|
|
291
289
|
# via python-slugify
|
|
292
290
|
typeguard==4.4.4
|
|
293
291
|
# via inflect
|
|
294
|
-
typer==0.
|
|
292
|
+
typer==0.21.0
|
|
295
293
|
# via frictionless
|
|
296
294
|
typing-extensions==4.15.0
|
|
297
295
|
# via
|
|
@@ -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.5.
|
|
32
|
-
__version_tuple__ = version_tuple = (6, 5,
|
|
31
|
+
__version__ = version = '6.5.7'
|
|
32
|
+
__version_tuple__ = version_tuple = (6, 5, 7)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import TYPE_CHECKING, Any, Dict
|
|
5
5
|
|
|
6
|
-
from hdx.api.utilities.size_hash import get_size_and_hash
|
|
7
6
|
from hdx.utilities.dateparse import now_utc_notz
|
|
7
|
+
from hdx.utilities.file_hashing import get_size_and_hash
|
|
8
8
|
|
|
9
9
|
if TYPE_CHECKING:
|
|
10
10
|
from hdx.data.resource import Resource
|
|
@@ -112,13 +112,9 @@ class FilestoreHelper:
|
|
|
112
112
|
force_update = kwargs.pop("force_update", False)
|
|
113
113
|
file_format = resource_data_to_update.get("format", "").lower()
|
|
114
114
|
size, hash = get_size_and_hash(file_to_upload, file_format)
|
|
115
|
-
if (
|
|
116
|
-
not force_update
|
|
117
|
-
and size == original_resource_data.get("size")
|
|
118
|
-
and hash == original_resource_data.get("hash")
|
|
119
|
-
):
|
|
115
|
+
if not force_update and hash == original_resource_data.get("hash"):
|
|
120
116
|
logger.warning(
|
|
121
|
-
f"Not updating filestore for resource {original_resource_data['name']} as
|
|
117
|
+
f"Not updating filestore for resource {original_resource_data['name']} as hash unchanged!"
|
|
122
118
|
)
|
|
123
119
|
if resource_data_to_update._url_backup:
|
|
124
120
|
resource_data_to_update["url"] = resource_data_to_update._url_backup
|
|
@@ -11,11 +11,11 @@ import hdx.data.dataset
|
|
|
11
11
|
import hdx.data.resource_matcher
|
|
12
12
|
from hdx.api.configuration import Configuration
|
|
13
13
|
from hdx.api.utilities.date_helper import DateHelper
|
|
14
|
-
from hdx.api.utilities.size_hash import get_size_and_hash
|
|
15
14
|
from hdx.data.hdxobject import HDXError, HDXObject
|
|
16
15
|
from hdx.data.resource_view import ResourceView
|
|
17
16
|
from hdx.utilities.dateparse import now_utc, now_utc_notz, parse_date
|
|
18
17
|
from hdx.utilities.downloader import Download
|
|
18
|
+
from hdx.utilities.file_hashing import get_size_and_hash
|
|
19
19
|
from hdx.utilities.retriever import Retrieve
|
|
20
20
|
from hdx.utilities.typehint import ListTuple
|
|
21
21
|
from hdx.utilities.uuid import is_valid_uuid
|
|
@@ -415,13 +415,9 @@ class Resource(HDXObject):
|
|
|
415
415
|
force_update = kwargs.pop("force_update", False)
|
|
416
416
|
file_format = self._old_data.get("format", "").lower()
|
|
417
417
|
size, hash = get_size_and_hash(self._file_to_upload, file_format)
|
|
418
|
-
if (
|
|
419
|
-
not force_update
|
|
420
|
-
and size == self.data.get("size")
|
|
421
|
-
and hash == self.data.get("hash")
|
|
422
|
-
):
|
|
418
|
+
if not force_update and hash == self.data.get("hash"):
|
|
423
419
|
logger.warning(
|
|
424
|
-
f"Not updating filestore for resource {self.data['name']} as
|
|
420
|
+
f"Not updating filestore for resource {self.data['name']} as hash unchanged!"
|
|
425
421
|
)
|
|
426
422
|
if self._url_backup:
|
|
427
423
|
self._old_data["url"] = self._url_backup
|
|
@@ -299,7 +299,7 @@ def dataset_mockshow(url, datadict):
|
|
|
299
299
|
# test existing size and hash same
|
|
300
300
|
resource = resultdictcopy["resources"][0]
|
|
301
301
|
resource["size"] = 23724
|
|
302
|
-
resource["hash"] = "
|
|
302
|
+
resource["hash"] = "b2f92ef4b1c895568421cb887859a13d"
|
|
303
303
|
result = json.dumps(resultdictcopy)
|
|
304
304
|
return MockResponse(
|
|
305
305
|
200,
|
|
@@ -774,7 +774,7 @@ class TestDatasetCore:
|
|
|
774
774
|
assert len(dataset._resources) == 3
|
|
775
775
|
result = dataset.get_resource()
|
|
776
776
|
assert result["size"] == 23724
|
|
777
|
-
assert result["hash"] == "
|
|
777
|
+
assert result["hash"] == "b2f92ef4b1c895568421cb887859a13d"
|
|
778
778
|
assert statuses == {"Resource1": 2, "Resource2": 1, "Resource3": 1}
|
|
779
779
|
resource["name"] = "123"
|
|
780
780
|
resource.set_file_to_upload(None)
|
|
@@ -848,7 +848,7 @@ class TestDatasetCore:
|
|
|
848
848
|
}
|
|
849
849
|
result = dataset.get_resource(2)
|
|
850
850
|
assert result["size"] == 23724
|
|
851
|
-
assert result["hash"] == "
|
|
851
|
+
assert result["hash"] == "b2f92ef4b1c895568421cb887859a13d"
|
|
852
852
|
assert dataset["state"] == "active"
|
|
853
853
|
assert len(dataset._resources) == 3
|
|
854
854
|
dataset = Dataset(datasetdata)
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_update_dataset_resources.py
RENAMED
|
@@ -326,7 +326,7 @@ class TestUpdateDatasetResourcesLogic:
|
|
|
326
326
|
{
|
|
327
327
|
"description": "test2",
|
|
328
328
|
"format": "xlsx",
|
|
329
|
-
"hash": "
|
|
329
|
+
"hash": "b2f92ef4b1c895568421cb887859a13d",
|
|
330
330
|
"name": "test2",
|
|
331
331
|
"resource_type": "file.upload",
|
|
332
332
|
"size": 23724,
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import hashlib
|
|
2
|
-
from io import BytesIO
|
|
3
|
-
from typing import Tuple
|
|
4
|
-
|
|
5
|
-
from openpyxl import load_workbook
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def get_size_and_hash(file_to_upload: str, file_format: str) -> Tuple[int, str]:
|
|
9
|
-
"""Return the size and hash of file to upload
|
|
10
|
-
|
|
11
|
-
Args:
|
|
12
|
-
file_to_upload: File to upload
|
|
13
|
-
file_format (str): File format
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
Tuple[int, str]: Tuple (size, hash)
|
|
17
|
-
"""
|
|
18
|
-
f = open(file_to_upload, "rb")
|
|
19
|
-
md5hash = hashlib.md5()
|
|
20
|
-
if file_format == "xlsx":
|
|
21
|
-
first_chunk = f.read(4096)
|
|
22
|
-
size = len(first_chunk)
|
|
23
|
-
signature = first_chunk[:4]
|
|
24
|
-
if signature == b"PK\x03\x04": # xlsx
|
|
25
|
-
xlsxbuffer = bytearray(first_chunk)
|
|
26
|
-
while chunk := f.read(4096):
|
|
27
|
-
size += len(chunk)
|
|
28
|
-
xlsxbuffer.extend(chunk)
|
|
29
|
-
workbook = load_workbook(filename=BytesIO(xlsxbuffer), read_only=True)
|
|
30
|
-
for sheet_name in workbook.sheetnames:
|
|
31
|
-
sheet = workbook[sheet_name]
|
|
32
|
-
for cols in sheet.iter_rows(values_only=True):
|
|
33
|
-
md5hash.update(bytes(str(cols), "utf-8"))
|
|
34
|
-
workbook.close()
|
|
35
|
-
return size, md5hash.hexdigest()
|
|
36
|
-
else:
|
|
37
|
-
md5hash.update(first_chunk)
|
|
38
|
-
else:
|
|
39
|
-
size = 0
|
|
40
|
-
while chunk := f.read(4096):
|
|
41
|
-
size += len(chunk)
|
|
42
|
-
md5hash.update(chunk)
|
|
43
|
-
return size, md5hash.hexdigest()
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
from hdx.api.utilities.size_hash import get_size_and_hash
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class TestSizeHash:
|
|
5
|
-
def test_get_size_and_hash(self, test_data, test_xlsx):
|
|
6
|
-
size, hash = get_size_and_hash(test_data, "csv")
|
|
7
|
-
assert size == 1548
|
|
8
|
-
assert hash == "3790da698479326339fa99a074cbc1f7"
|
|
9
|
-
|
|
10
|
-
size, hash = get_size_and_hash(test_xlsx, "xlsx")
|
|
11
|
-
assert size == 23724
|
|
12
|
-
assert hash == "6b8acf7e28d62685a1e829e7fa220d17"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/src/hdx/data/indicator_resource_view_template.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
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_datasource_topline.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_datasource_topline.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_email_configuration.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_email_configuration.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_missing_site_config.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_organization_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_organization_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_view_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_resource_view_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_showcase_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_showcase_static.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_vocabulary_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/hdx_vocabulary_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/project_configuration.json
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/project_configuration.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/config/user_agent_config_wrong.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
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/conflict_data_alg.csv
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/qc_conflict_data_alg.csv
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/test_data_no_data.csv
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/gen_resource/test_data_no_years.csv
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/qc_from_rows/qc_conflict_data_alg.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/fixtures/showcase_all_search_results.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_dataset_title_helper.py
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_filestore_helper.py
RENAMED
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/api/utilities/test_hdx_error_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.5.6 → hdx_python_api-6.5.7}/tests/hdx/data/test_dataset_resource_generation.py
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
|