Skip to content

Commit b62b990

Browse files
committed
Use get_size_and_hash from HDX Python Utilities
1 parent 0999a7a commit b62b990

6 files changed

Lines changed: 20 additions & 61 deletions

File tree

documentation/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The library has detailed API documentation which can be found in the menu at the
5454

5555

5656
## Breaking Changes
57+
From 6.5.7, get_size_and_hash moved to HDX Python Utilities
58+
5759
From 6.5.2, remove unused `generate_qc_resource_from_rows` method.
5860
`generate_resource_from_rows`, `generate_resource_from_iterable` and
5961
`download_and_generate_resource` are deprecated. They are replaced by
@@ -906,11 +908,11 @@ corresponding id and that resource on HDX will be overwritten.
906908

907909
resource.create_in_hdx(dataset=DATASET)
908910

909-
Alternatively, if a resource doesn't have an id, but contains a package_id, the create
910-
and update methods will use it to load the corresponding dataset, the resource will be
911-
assigned to that dataset and it will be compared to resources in that dataset. If a
912-
match is found, then the resource will be given the corresponding id and that resource
913-
on HDX will be overwritten.
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.
914916

915917
You can download a resource using the **download** function eg.
916918

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies = [
3838
"defopt>=7.0.0",
3939
"email_validator",
4040
"hdx-python-country>=3.9.8",
41-
"hdx-python-utilities>=3.9.6",
41+
"hdx-python-utilities>=3.9.7",
4242
"libhxl>=5.2.2",
4343
"makefun",
4444
"quantulum3",

requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ click==8.3.1
3232
# typer
3333
colorama==0.4.6
3434
# via mkdocs-material
35-
coverage==7.13.0
35+
coverage==7.13.1
3636
# via pytest-cov
3737
defopt==7.0.0
3838
# via hdx-python-api (pyproject.toml)
@@ -44,7 +44,7 @@ docopt==0.6.2
4444
# via
4545
# ckanapi
4646
# num2words
47-
docutils==0.22.3
47+
docutils==0.22.4
4848
# via defopt
4949
email-validator==2.3.0
5050
# via hdx-python-api (pyproject.toml)
@@ -66,11 +66,11 @@ gspread==6.2.1
6666
# via hdx-python-api (pyproject.toml)
6767
hdx-python-country==3.9.8
6868
# via hdx-python-api (pyproject.toml)
69-
hdx-python-utilities==3.9.6
69+
hdx-python-utilities==3.9.7
7070
# via
7171
# hdx-python-api (pyproject.toml)
7272
# hdx-python-country
73-
humanize==4.14.0
73+
humanize==4.15.0
7474
# via frictionless
7575
identify==2.6.15
7676
# via pre-commit
@@ -137,13 +137,13 @@ mkdocs==1.6.1
137137
# mkdocs-material
138138
mkdocs-get-deps==0.2.0
139139
# via mkdocs
140-
mkdocs-material==9.7.0
140+
mkdocs-material==9.7.1
141141
# via mkapi
142142
mkdocs-material-extensions==1.3.1
143143
# via mkdocs-material
144144
more-itertools==10.8.0
145145
# via inflect
146-
nodeenv==1.9.1
146+
nodeenv==1.10.0
147147
# via pre-commit
148148
num2words==0.5.14
149149
# via quantulum3
@@ -192,7 +192,7 @@ pygments==2.19.2
192192
# mkdocs-material
193193
# pytest
194194
# rich
195-
pymdown-extensions==10.19.1
195+
pymdown-extensions==10.20
196196
# via mkdocs-material
197197
pyphonetics==0.5.3
198198
# via hdx-python-utilities
@@ -259,9 +259,9 @@ rpds-py==0.30.0
259259
# referencing
260260
rsa==4.9.1
261261
# via google-auth
262-
ruamel-yaml==0.18.17
262+
ruamel-yaml==0.19.0
263263
# via hdx-python-utilities
264-
ruamel-yaml-clib==0.2.15
264+
ruamel-yaml-clibz==0.3.4
265265
# via ruamel-yaml
266266
setuptools==80.9.0
267267
# via ckanapi
@@ -291,7 +291,7 @@ text-unidecode==1.3
291291
# via python-slugify
292292
typeguard==4.4.4
293293
# via inflect
294-
typer==0.20.0
294+
typer==0.21.0
295295
# via frictionless
296296
typing-extensions==4.15.0
297297
# via

src/hdx/api/utilities/filestore_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import logging
44
from typing import TYPE_CHECKING, Any, Dict
55

6-
from hdx.api.utilities.size_hash import get_size_and_hash
76
from hdx.utilities.dateparse import now_utc_notz
7+
from hdx.utilities.file_hashing import get_size_and_hash
88

99
if TYPE_CHECKING:
1010
from hdx.data.resource import Resource

src/hdx/api/utilities/size_hash.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/hdx/data/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import hdx.data.resource_matcher
1212
from hdx.api.configuration import Configuration
1313
from hdx.api.utilities.date_helper import DateHelper
14-
from hdx.api.utilities.size_hash import get_size_and_hash
1514
from hdx.data.hdxobject import HDXError, HDXObject
1615
from hdx.data.resource_view import ResourceView
1716
from hdx.utilities.dateparse import now_utc, now_utc_notz, parse_date
1817
from hdx.utilities.downloader import Download
18+
from hdx.utilities.file_hashing import get_size_and_hash
1919
from hdx.utilities.retriever import Retrieve
2020
from hdx.utilities.typehint import ListTuple
2121
from hdx.utilities.uuid import is_valid_uuid

0 commit comments

Comments
 (0)