dcor-shared 1.0.3__tar.gz → 1.0.4__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.
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/CHANGELOG +3 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/PKG-INFO +1 -1
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/_version.py +2 -2
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/s3cc.py +13 -6
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared.egg-info/PKG-INFO +1 -1
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/.github/workflows/check.yml +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/.github/workflows/deploy_pypi.yml +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/.gitignore +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/LICENSE +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/MANIFEST.in +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/README.rst +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/__init__.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/ckan.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/data.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/dcinst.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/mime.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/parse.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/paths.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/rqjob.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/s3.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/testing.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared/util.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared.egg-info/SOURCES.txt +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared.egg-info/dependency_links.txt +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared.egg-info/requires.txt +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/dcor_shared.egg-info/top_level.txt +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/pyproject.toml +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/setup.cfg +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/data/calibration_beads_47.rtdc +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/requirements.txt +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/test_ckan.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/test_data.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/test_s3.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/test_s3cc.py +0 -0
- {dcor_shared-1.0.3 → dcor_shared-1.0.4}/tests/test_testing.py +0 -0
|
@@ -34,10 +34,12 @@ def artifact_exists(
|
|
|
34
34
|
return s3.object_exists(bucket_name=bucket_name, object_name=object_name)
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
def compute_checksum(
|
|
37
|
+
def compute_checksum(
|
|
38
|
+
resource_id: str,
|
|
39
|
+
artifact: Literal["condensed", "preview", "resource"] = "resource"):
|
|
38
40
|
"""Compute the SHA256 checksum of the corresponding CKAN resource"""
|
|
39
41
|
bucket_name, object_name = get_s3_bucket_object_for_artifact(
|
|
40
|
-
resource_id=resource_id, artifact=
|
|
42
|
+
resource_id=resource_id, artifact=artifact)
|
|
41
43
|
s3h = s3.compute_checksum(bucket_name=bucket_name, object_name=object_name)
|
|
42
44
|
return s3h
|
|
43
45
|
|
|
@@ -188,12 +190,19 @@ def get_s3_bucket_name_for_resource(resource_id):
|
|
|
188
190
|
|
|
189
191
|
def get_s3_dc_handle(
|
|
190
192
|
resource_id: str,
|
|
191
|
-
artifact: Literal["condensed", "preview", "resource"] = "resource"
|
|
193
|
+
artifact: Literal["condensed", "preview", "resource"] = "resource",
|
|
194
|
+
enable_basins: bool = False,
|
|
195
|
+
):
|
|
192
196
|
"""Return an instance of :class:`RTDC_S3`
|
|
193
197
|
|
|
194
198
|
The data are accessed directly via S3 using DCOR's access credentials.
|
|
195
199
|
Use this if you need to access the original raw file.
|
|
196
200
|
|
|
201
|
+
If you set `enable_basins` to True, basins of the data on S3 will
|
|
202
|
+
be considered. This is turned off for performance reasons. Note that
|
|
203
|
+
since an instance of `RTDC_S3` is returned, no local basins are
|
|
204
|
+
allowed.
|
|
205
|
+
|
|
197
206
|
The resource with the identifier `resource_id` must exist in the
|
|
198
207
|
CKAN database.
|
|
199
208
|
"""
|
|
@@ -204,9 +213,7 @@ def get_s3_dc_handle(
|
|
|
204
213
|
"dcor_object_store.access_key_id"),
|
|
205
214
|
secret_access_key=get_ckan_config_option(
|
|
206
215
|
"dcor_object_store.secret_access_key"),
|
|
207
|
-
|
|
208
|
-
# local file system (security).
|
|
209
|
-
enable_basins=False,
|
|
216
|
+
enable_basins=enable_basins,
|
|
210
217
|
)
|
|
211
218
|
return ds
|
|
212
219
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|