hestia-earth-utils 0.15.6__tar.gz → 0.15.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.
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/PKG-INFO +1 -1
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pipeline.py +12 -1
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_s3_client.py +14 -0
- hestia_earth_utils-0.15.7/hestia_earth/utils/version.py +1 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/PKG-INFO +1 -1
- hestia_earth_utils-0.15.6/hestia_earth/utils/version.py +0 -1
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/MANIFEST.in +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/README.md +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/bin/hestia-format-upload +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/bin/hestia-pivot-csv +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/__init__.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/__init__.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/api.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/blank_node.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/calculation_status.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/cycle.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/date.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/descriptive_stats.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/emission.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/lookup.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/lookup_utils.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/model.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/__init__.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/_shared.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/pivot_csv.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/pivot_json.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/request.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/stats.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/__init__.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_azure_client.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_local_client.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_sns_client.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/table.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/term.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/tools.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/SOURCES.txt +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/dependency_links.txt +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/requires.txt +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/top_level.txt +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/setup.cfg +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/setup.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/tests/pivot/__init__.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/tests/pivot/test_pivot_csv.py +0 -0
- {hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/tests/pivot/test_pivot_json.py +0 -0
|
@@ -4,7 +4,9 @@ import numpy as np
|
|
|
4
4
|
|
|
5
5
|
from .tools import current_time_ms, non_empty_list, flatten
|
|
6
6
|
from .api import find_related
|
|
7
|
-
from .storage._s3_client import
|
|
7
|
+
from .storage._s3_client import (
|
|
8
|
+
_load_from_bucket, _upload_to_bucket, _last_modified, _read_metadata, _update_metadata, _exists_in_bucket
|
|
9
|
+
)
|
|
8
10
|
from .storage._sns_client import _get_sns_client
|
|
9
11
|
|
|
10
12
|
PROGRESS_EXT = '.progress'
|
|
@@ -156,6 +158,15 @@ def _node_id(node: dict): return node.get('@id', node.get('id'))
|
|
|
156
158
|
def _node_path(node: dict, folder: str = ''): return join(folder, _node_type(node), f"{_node_id(node)}.jsonld")
|
|
157
159
|
|
|
158
160
|
|
|
161
|
+
def _load_node(bucket: str, file_key: str): return json.loads(_load_from_bucket(bucket, file_key))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def _cache_path(node: dict): return join(_node_type(node), f"{_node_id(node)}.cache")
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def _has_cache(bucket: str, node: dict): return _exists_in_bucket(bucket, _cache_path(node))
|
|
168
|
+
|
|
169
|
+
|
|
159
170
|
def is_calculating(bucket: str, node: dict, folder: str = ''):
|
|
160
171
|
return _read_metadata(bucket, _node_path(node, folder)).get(METADATA_PROGRESS_KEY, 'false') == 'true'
|
|
161
172
|
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_s3_client.py
RENAMED
|
@@ -95,3 +95,17 @@ def _list_bucket_objects(bucket: str, folder: str = ''):
|
|
|
95
95
|
return contents
|
|
96
96
|
except ClientError:
|
|
97
97
|
return []
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _delete_objects(bucket: str, objects: list):
|
|
101
|
+
from botocore.exceptions import ClientError
|
|
102
|
+
try:
|
|
103
|
+
return _get_s3_client().delete_objects(
|
|
104
|
+
Bucket=bucket,
|
|
105
|
+
Delete={
|
|
106
|
+
'Objects': objects,
|
|
107
|
+
'Quiet': True
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
except ClientError:
|
|
111
|
+
return None
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '0.15.7'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '0.15.6'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/calculation_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/descriptive_stats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/pivot_csv.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/pivot/pivot_json.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/__init__.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_azure_client.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_local_client.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth/utils/storage/_sns_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.6 → hestia_earth_utils-0.15.7}/hestia_earth_utils.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|