ellipsis 3.2.3__py3-none-any.whl → 3.2.5__py3-none-any.whl

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.

Potentially problematic release.


This version of ellipsis might be problematic. Click here for more details.

ellipsis/__init__.py CHANGED
@@ -6,7 +6,7 @@ from ellipsis import user
6
6
  from ellipsis import path
7
7
  from ellipsis import util
8
8
  from ellipsis import compute
9
- __version__ = '3.2.3'
9
+ __version__ = '3.2.5'
10
10
 
11
11
 
12
12
 
ellipsis/compute/root.py CHANGED
@@ -10,8 +10,9 @@ from ellipsis.path.raster.timestamp.file import add as addFile
10
10
  from ellipsis.path.raster.timestamp import activate
11
11
  from io import BytesIO
12
12
 
13
- def createCompute(layers, token, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True, largeResult = False):
13
+ def createCompute(layers, token, files = None, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True, largeResult = False):
14
14
  layers = sanitize.validDictArray('layers', layers, True)
15
+ files = sanitize.validUuidArray('files', files, False)
15
16
  token = sanitize.validString('token', token, True)
16
17
  nodes = sanitize.validInt('nodes', nodes, False)
17
18
  interpreter = sanitize.validString('interpreter', interpreter, True)
@@ -25,11 +26,12 @@ def createCompute(layers, token, nodes=None, interpreter='python3.12', requireme
25
26
 
26
27
  requirements = "\n".join(requirements)
27
28
 
28
- body = {'layers':layers, 'interpreter':interpreter, 'nodes':nodes, 'requirements':requirements, 'largeResult': largeResult}
29
+ body = {'layers':layers, 'files':files, 'interpreter':interpreter, 'nodes':nodes, 'requirements':requirements, 'largeResult': largeResult}
29
30
  r = apiManager.post('/compute', body, token)
30
31
 
31
32
  computeId = r['id']
32
33
  while awaitTillStarted:
34
+ print('waiting')
33
35
  res = listComputes(token=token)['result']
34
36
  r = [x for x in res if x['id'] == computeId][0]
35
37
  if r['status'] == 'available':
@@ -58,6 +60,7 @@ def execute(computeId, f, token, awaitTillCompleted=True):
58
60
  while awaitTillCompleted:
59
61
  res = listComputes(token=token)['result']
60
62
  r = [x for x in res if x['id'] == computeId][0]
63
+ print('waiting')
61
64
  if r['status'] == 'completed':
62
65
  break
63
66
  time.sleep(1)
@@ -145,14 +148,26 @@ def addToLayer(response, pathId, timestampId, token):
145
148
  token = sanitize.validString('token', token, True)
146
149
 
147
150
  for url in response:
148
- memfile = downloadFile(url, token)
149
- addFile(pathId = pathId, timestampId=timestampId, token = token, fileFormat='tif', memFile=memfile, name='out.tif')
151
+ print('fetching file ' + url.split('/')[-1])
152
+ memfile = BytesIO()
153
+ memfile = downloadFile(url, token, memfile=memfile)
154
+ print('read file ' + url.split('/')[-1])
155
+ addFile(pathId = pathId, timestampId=timestampId, token = token, fileFormat='tif', memFile=memfile, name= url.split('/')[-1] )
156
+ print('file ' + url.split('/')[-1] + ' added to layer')
150
157
  activate(pathId=pathId, timestampId=timestampId, token=token)
158
+ print('layer can now be found at ' + apiManager.baseUrl + '/drive/me?pathId=' + pathId )
151
159
 
152
160
 
153
161
 
154
- def downloadFile(url, token):
155
- memfile = BytesIO()
156
- apiManager.download(url = url, filePath='', memfile=memfile, token = token)
157
- memfile.seek(0)
158
- return memfile
162
+ def downloadFile(url, token, filePath = None, memfile = None):
163
+
164
+ url = sanitize.validString('url', url, True)
165
+ token = sanitize.validString('token', token, True)
166
+ filePath = sanitize.validString('filePath', filePath, False)
167
+ if memfile == None and filePath == None:
168
+ raise ValueError('Either memfile or filePath is required')
169
+
170
+ apiManager.download(url = url, filePath=filePath, memfile=memfile, token = token)
171
+
172
+ if memfile != None:
173
+ return memfile
@@ -22,7 +22,8 @@ def add( token, filePath=None, memFile=None, parentId = None, publicAccess =Non
22
22
 
23
23
  seperator = os.path.sep
24
24
  fileName = filePath.split(seperator)[len(filePath.split(seperator))-1 ]
25
-
25
+ if len(fileName) > 64:
26
+ fileName = fileName[0:63]
26
27
  body = {'name':fileName, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
27
28
  if type(memFile) == type(None):
28
29
  r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
@@ -1,15 +1,17 @@
1
1
  from ellipsis import apiManager
2
2
  from ellipsis import sanitize
3
3
 
4
- def add(pathId, name, method, parameters, token, default=True):
4
+ def add(pathId, name, parameters, token, default=True, method = None):
5
5
  token = sanitize.validString('token', token, True)
6
6
  pathId = sanitize.validUuid('pathId', pathId, True)
7
- method = sanitize.validString('method', method, True)
7
+ method = sanitize.validString('method', method, False)
8
8
  name = sanitize.validString('name', name, True)
9
9
  default = sanitize.validBool('default', default, True)
10
10
  parameters = sanitize.validObject('parameters', parameters, True)
11
-
12
- body = {'name':name, 'method': method, 'parameters':parameters, 'default':default}
11
+ if type(method) == type(None):
12
+ body = {'name':name, 'parameters':parameters, 'default':default}
13
+ else:
14
+ body = {'name':name, 'method': method, 'parameters':parameters, 'default':default}
13
15
  r = apiManager.post('/path/' + pathId + '/raster/style', body, token)
14
16
  return r
15
17
 
@@ -29,7 +31,6 @@ def edit(pathId, styleId, method, parameters, token, name=None, default = None):
29
31
  method = sanitize.validString('method', method, True)
30
32
  parameters = sanitize.validObject('parameters', parameters, True)
31
33
  default = sanitize.validBool('default', default, False)
32
- default = sanitize.validString('name', name, False)
33
34
 
34
35
  body = {'method': method, 'parameters':parameters, 'default':default, 'name':name}
35
36
  r = apiManager.patch('/path/' + pathId + '/raster/style/' + styleId, body, token)
@@ -3,14 +3,16 @@ from ellipsis import sanitize
3
3
 
4
4
 
5
5
 
6
- def add(pathId, name, method, parameters, token, default = True):
6
+ def add(pathId, name, parameters, token, default = True, method = None):
7
7
  pathId = sanitize.validUuid('pathId', pathId, True)
8
- method = sanitize.validString('method', method, True)
8
+ method = sanitize.validString('method', method, False)
9
9
  parameters = sanitize.validObject('parameters', parameters, True)
10
10
  token = sanitize.validString('token', token, True)
11
11
  default = sanitize.validBool('default', default, True)
12
-
13
- body = {'name': name, 'default':default, 'method': method, 'parameters':parameters}
12
+ if type(method) == type(None):
13
+ body = {'name': name, 'default':default, 'parameters':parameters}
14
+ else:
15
+ body = {'name': name, 'default':default, 'method': method, 'parameters':parameters}
14
16
 
15
17
  r = apiManager.post('/path/' + pathId + '/vector/style', body, token)
16
18
  return r
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.2.3
3
+ Version: 3.2.5
4
4
  Summary: Package to interact with the Ellipsis API
5
5
  Home-page: https://github.com/ellipsis-drive-internal/python-package
6
6
  Author: Daniel van der Maas
@@ -1,4 +1,4 @@
1
- ellipsis/__init__.py,sha256=HIFPMdYQQE4ad73-VzjQhkZ-Xif4ByuPRfOxTCdrAws,237
1
+ ellipsis/__init__.py,sha256=Xq5ME2jrM4pfTuo3cfhoqva3kOPPco5VggdJizI63Po,237
2
2
  ellipsis/apiManager.py,sha256=iX6XFwilMfuCQYioAmgRgReL8W63FUBr3UC506ucIF4,5603
3
3
  ellipsis/sanitize.py,sha256=VuTPjHAUNCGUaOzKU2ojloiEN8kPhm53fIjbk6E9IEg,10597
4
4
  ellipsis/account/__init__.py,sha256=jTmwL9HVS27vAHPC_2a98RQJWbpSKBN4ptiXpY0qJgk,101
@@ -6,13 +6,13 @@ ellipsis/account/root.py,sha256=p8AehZQizaPlpGdFB5RsMduyUF4ynN0cGDz41nIxjYM,1942
6
6
  ellipsis/account/accessToken/__init__.py,sha256=ivwhK1eC4g74PAKaeTReb1QhIpKXyvmfdqZV6wDY-EY,66
7
7
  ellipsis/account/accessToken/root.py,sha256=TYo8wTyWyzytaqOTsuQC-Vn3y7BhYMC88EItZafpISA,1281
8
8
  ellipsis/compute/__init__.py,sha256=zcjm8GX1kSi5PEK5CXsR3wc2wxBdy3EIMo_y1sFEguQ,115
9
- ellipsis/compute/root.py,sha256=4FTcMDQARJuRZgFvo3Sfk_3Z3rpy737JvH0fsxUG-E8,5324
9
+ ellipsis/compute/root.py,sha256=VEI9FNVQOPqzkC7m3P64SZUnOf6KS9Qp-90TisohivI,6084
10
10
  ellipsis/path/__init__.py,sha256=NzdcTpXpicdrBWLgsFP6WY7ARIBKUFnkwa5VuB1Qdpc,506
11
11
  ellipsis/path/root.py,sha256=GqiYjAkdSchkQf1NzcSFZvBrmoQir7K2fqmZosqghFM,7953
12
12
  ellipsis/path/bookmark/__init__.py,sha256=vNrqGcWl5MN_xVAiClP6W6NilmsV-fqYOnJukbYcNwc,56
13
13
  ellipsis/path/bookmark/root.py,sha256=knhVIVAJS0jBT6JLdVgnufVRdxIR0VZBYfv292hg6xY,1285
14
14
  ellipsis/path/file/__init__.py,sha256=i_KB1S1J9pZjcPTKdyGMnjJf2tCoHFzptLGaxmTi55A,107
15
- ellipsis/path/file/root.py,sha256=zY7Hc5hRZkSvRsHnjfYwTTBBLcg9sYhbuqvXP_yWjxk,4993
15
+ ellipsis/path/file/root.py,sha256=xBQBBdISRw3BDp8FqX5s-Mki1wwYjN2U6bvHWIZv_1U,5045
16
16
  ellipsis/path/folder/__init__.py,sha256=5keiFbsuXj5bYQHt8NahGkUYvXrJk8C7cQhgHA-4VBc,139
17
17
  ellipsis/path/folder/root.py,sha256=OJSaOLWPQDXXty5sxsG_G0Fiip0VdWzj_XrcxY9Gnj8,1913
18
18
  ellipsis/path/hashtag/__init__.py,sha256=4u8VC7xOFJjuZ9K08yh6GsPn8YkYZ_24o_7viScUQlg,59
@@ -33,7 +33,7 @@ ellipsis/path/pointCloud/timestamp/order/root.py,sha256=ni4lYOmatqLg5NQ1VTLeG9R7
33
33
  ellipsis/path/raster/__init__.py,sha256=xWEsdpQxsqnwSdRqmZujS3pEUAmemHmUCtMKCaWLK0M,217
34
34
  ellipsis/path/raster/root.py,sha256=-y0SEukHEYUDvyJyDI1x7gtcDm-Wum_Ze7ekSYJr6O4,1749
35
35
  ellipsis/path/raster/style/__init__.py,sha256=mxlqVtSd2dsKai3DAVQjtNsh2KnTrZVyF8loRwUNT7E,61
36
- ellipsis/path/raster/style/root.py,sha256=YFQlGTdgjpwXn4h0ug7LrQZFLmRp2bdJN71A0iqZRFo,1627
36
+ ellipsis/path/raster/style/root.py,sha256=W9paEo_5nE-OpfoTwrrxNaSo1V-vnpGoA4H3rL043gQ,1696
37
37
  ellipsis/path/raster/timestamp/__init__.py,sha256=brmFXg69CKRcWaAfPbxWfsvHvnn5q8GBQhVzUTVb4_w,842
38
38
  ellipsis/path/raster/timestamp/root.py,sha256=6fGels-BtxWpF6EarxWni-AHK-5r2kb7fqVUFEnLNY4,17519
39
39
  ellipsis/path/raster/timestamp/util.py,sha256=eupFFSBp5CaTDIRg6DYnZnfWY61h81JZ7c15NdJ-j5E,2580
@@ -50,7 +50,7 @@ ellipsis/path/vector/root.py,sha256=P8zKEA6b4F9sQ7di5FHtiHrp3wnG49QVfDgq68_n7Ek,
50
50
  ellipsis/path/vector/featureProperty/__init__.py,sha256=-S6G0Sq66m8HVTg4bCp33fsUzYq-2hPueg5BotSpk2Q,81
51
51
  ellipsis/path/vector/featureProperty/root.py,sha256=eb2bw4UGO3eYGaYgjwu43pZyA4iAjQTik_4HurZaGbM,2111
52
52
  ellipsis/path/vector/style/__init__.py,sha256=riiDnL4FDq4EFhSYAYHBSe_o5oltRTSrj4sc72F6IVQ,63
53
- ellipsis/path/vector/style/root.py,sha256=09PsRbCJ35YV8bl8xoWFoeGRpdmf5IBmmqwhRj30OTM,1641
53
+ ellipsis/path/vector/style/root.py,sha256=l78kbpeHwZCbQkc1HhKK9Lf-vq41BXjnAGhiEJNJZ5w,1772
54
54
  ellipsis/path/vector/timestamp/__init__.py,sha256=n0ncRxXoQIDX1WeV0lbpJH1BND793CdZ5swGgeu1Kfk,330
55
55
  ellipsis/path/vector/timestamp/root.py,sha256=MrYfAUKzmIXnt8DYRYU9YB6pqnNexcWcXUu4Ze3WUGc,11296
56
56
  ellipsis/path/vector/timestamp/feature/__init__.py,sha256=miaLCHkogL9KJ_eUr4K_N15BShAe2ivcppDFJuE_SgI,210
@@ -67,8 +67,8 @@ ellipsis/user/__init__.py,sha256=um_b42pc2otFiQRGqMajcEtONQpC2ei4r-EY3j7bsfQ,43
67
67
  ellipsis/user/root.py,sha256=dsMK6wGBdeCmOd3YsbIv9cEcQ6tAiSGr0jmtBhQl5-0,484
68
68
  ellipsis/util/__init__.py,sha256=_sNBUXDKJVGffRyt93xdUrJ4gON651Sp-unr7LKVCEc,756
69
69
  ellipsis/util/root.py,sha256=3pw-tXGTQC5PMUtpReJEA9rgyJZNlTM3uUISPz2Sq6Q,23976
70
- ellipsis-3.2.3.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
- ellipsis-3.2.3.dist-info/METADATA,sha256=hI6pIwOoWjIROT2Zbz3TEAsc8V-XhLvHKkZk4fEV-Ag,1842
72
- ellipsis-3.2.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
- ellipsis-3.2.3.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
- ellipsis-3.2.3.dist-info/RECORD,,
70
+ ellipsis-3.2.5.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
+ ellipsis-3.2.5.dist-info/METADATA,sha256=Bq9u-nF9sVPeYDjAeVCld8NWDHIsFO9qrqUkXs7l-_g,1842
72
+ ellipsis-3.2.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
+ ellipsis-3.2.5.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
+ ellipsis-3.2.5.dist-info/RECORD,,