ellipsis 3.1.46__py3-none-any.whl → 3.1.48__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
 
9
- __version__ = '3.1.46'
9
+ __version__ = '3.1.48'
10
10
 
11
11
 
12
12
 
ellipsis/apiManager.py CHANGED
@@ -74,8 +74,10 @@ def call(method, url, body = None, token = None, crash = True, parseJson = True)
74
74
  try:
75
75
  r = actualCall(method, url, body, token)
76
76
  break
77
- except:
77
+ except Exception as ex:
78
78
  print('time out detected, retrying request')
79
+ print('url', url)
80
+ print('error',ex)
79
81
  time.sleep(WAIT)
80
82
  tried = tried +1
81
83
  if tried >= RETRIES:
@@ -125,7 +127,8 @@ def upload(url, filePath, body, token, key = 'data', memfile= None):
125
127
  conn_file = memfile
126
128
 
127
129
  payload = MultipartEncoder(fields = {**body, key: (fileName, conn_file, 'application/octet-stream')})
128
- token = 'Bearer ' + token
130
+ if not 'Bearer' in token:
131
+ token = 'Bearer ' + token
129
132
 
130
133
  r = requests.post(baseUrl + url, headers = {"Authorization":token, "Content-Type": payload.content_type}, data=payload, verify=False)
131
134
 
ellipsis/path/__init__.py CHANGED
@@ -9,4 +9,5 @@ from ellipsis.path import usage
9
9
  from ellipsis.path import folder
10
10
  from ellipsis.path import file
11
11
  from ellipsis.path import bookmark
12
+ from ellipsis.path import setUpTask
12
13
 
@@ -8,20 +8,27 @@ import json
8
8
  import pandas as pd
9
9
 
10
10
 
11
- def add( filePath, token, parentId = None, publicAccess =None, metadata=None):
11
+ def add( token, filePath=None, memFile=None, parentId = None, publicAccess =None, metadata=None,name=None):
12
12
  token = sanitize.validString('token', token, True)
13
13
  parentId = sanitize.validUuid('parentId', parentId, False)
14
14
  publicAccess = sanitize.validObject('publicAccess', publicAccess, False)
15
15
  metadata = sanitize.validObject('metadata', metadata, False)
16
+ filePath = sanitize.validString('filePath', filePath, False)
17
+ name = sanitize.validString('name', name, False)
18
+ if type(memFile) == type(None) and type(filePath) == type(None):
19
+ raise ValueError('You need to specify either a filePath or a memFile')
20
+ if type(memFile) != type(None) and type(name) == type(None):
21
+ raise ValueError('Parameter name is required when using a memory file')
16
22
 
17
-
18
-
19
23
  seperator = os.path.sep
20
24
  fileName = filePath.split(seperator)[len(filePath.split(seperator))-1 ]
21
25
 
22
26
  body = {'name':fileName, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
27
+ if type(memFile) == type(None):
28
+ r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
29
+ else:
30
+ r = apiManager.upload('/path/file' , filePath , name, body, token, memfile = memFile)
23
31
 
24
- r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
25
32
  return r
26
33
 
27
34
 
@@ -179,7 +179,7 @@ def getRaster(pathId, timestampId, extent, token = None, showProgress = True, ep
179
179
  as_jpg = info['raster']['asJpg']
180
180
  num_bands = len(bands)
181
181
  dtype = info['raster']['format']
182
-
182
+ accessLevel = info['yourAccess']['accessLevel']
183
183
  timestamps = info['raster']['timestamps']
184
184
  all_timestamps = [item['id'] for item in timestamps]
185
185
  if not timestampId in all_timestamps:
@@ -212,7 +212,7 @@ def getRaster(pathId, timestampId, extent, token = None, showProgress = True, ep
212
212
 
213
213
  N=0
214
214
  w = 256
215
- if not skipTar and ((x2_osm - x1_osm) * (y2_osm - y1_osm) > 50 or forceTar):
215
+ if not skipTar and ((x2_osm - x1_osm) * (y2_osm - y1_osm) > 50 and accessLevel > 100 or forceTar):
216
216
  tarZoom = next(item for item in timestamps if item["id"] == timestampId)['tarZoom']
217
217
 
218
218
  if type(tarZoom) != type(None):
ellipsis/path/root.py CHANGED
@@ -155,24 +155,12 @@ def recover(pathId, token):
155
155
  }, token)
156
156
 
157
157
 
158
- def delete(pathId, token, recursive = False):
158
+ def delete(pathId, token):
159
159
  pathId = sanitize.validUuid('pathId', pathId, True)
160
160
  token = sanitize.validString('token', token, False)
161
- recursive = sanitize.validBool('recursive', recursive, True)
162
161
 
163
- if recursive:
164
- info = get(pathId, token)
165
- if info['type'] == 'folder':
166
- folders = listFolder(pathId = pathId, includeTrashed=True, pathTypes=['folder'], token=token)['result']
167
- for f in folders:
168
- delete(f['id'], token, True)
169
- maps = listFolder(pathId=pathId, pathTypes=['raster','vector','file', 'pointCloud'], includeTrashed=True, token=token)['result']
170
- for m in maps:
171
- delete(m['id'], token, True)
172
- apiManager.delete(f'/path/{pathId}', None, token)
173
-
174
- else:
175
- return apiManager.delete(f'/path/{pathId}', None, token)
162
+
163
+ return apiManager.delete(f'/path/{pathId}', None, token)
176
164
 
177
165
  def editPublicAccess(pathId, token, access = None, hidden=None, recursive = False):
178
166
  pathId = sanitize.validUuid('pathId', pathId, True)
@@ -0,0 +1,2 @@
1
+ from ellipsis.path.setUpTask.root import get, copernicusImport, fileImport
2
+
@@ -0,0 +1,50 @@
1
+ from ellipsis import apiManager
2
+ from ellipsis import sanitize
3
+ import os
4
+
5
+ def get(token):
6
+ token = sanitize.validString('token', token, False)
7
+
8
+ r = apiManager.get('/path/setUpTask', {}, token)
9
+
10
+ return r
11
+
12
+
13
+ def copernicusImport( parameters, token):
14
+ token = sanitize.validString('token', token, True)
15
+ parameters = sanitize.validObject('parameters', parameters, True)
16
+ r = apiManager.post('/path/setUpTask', {'type':'copernicusImport', 'parameters':parameters}, token)
17
+
18
+ return r
19
+
20
+
21
+ def fileImport( token, memFile=None, parentId = None, filePath=None, fileFormat = 'geopackage', name = None):
22
+ token = sanitize.validString('token', token, True)
23
+ parentId = sanitize.validUuid(('parentId', parentId, False))
24
+ filePath = sanitize.validString('filePath', filePath, False)
25
+ name = sanitize.validString('name', name, False)
26
+ fileFormat = sanitize.validString('fileFormat', fileFormat, True)
27
+
28
+
29
+ if type(memFile) == type(None) and type(filePath) == type(None):
30
+ raise ValueError('You need to specify either a filePath or a memFile')
31
+ if type(memFile) != type(None) and type(name) == type(None):
32
+ raise ValueError('Parameter name is required when using a memory file')
33
+
34
+ if type(name) != type(None):
35
+ nameToUse = name
36
+ else:
37
+ seperator = os.path.sep
38
+ nameToUse = filePath.split(seperator)[len(filePath.split(seperator)) - 1]
39
+
40
+ parameters = {'name': nameToUse, 'parentId': parentId}
41
+ body = {'type': fileFormat + 'Import', 'parameters': parameters}
42
+ if type(memFile) == type(None):
43
+ r = apiManager.post('/path/setUpTask', body, token)
44
+ else:
45
+ r = apiManager.upload('/path/setUpTask' , filePath , name, body, token, memfile = memFile)
46
+ return r
47
+
48
+
49
+
50
+
@@ -82,17 +82,17 @@ def add(pathId, timestampId, seriesData, token, featureId=None, showProgress = T
82
82
  df_sub['value'] = seriesData[c].astype(float)
83
83
  dfs_long = dfs_long + [df_sub]
84
84
  seriesData_long = pd.concat(dfs_long)
85
-
86
85
  if uploadAsFile:
87
86
 
88
87
  memfile = BytesIO()
89
- seriesData_long.to_csv(memfile)
88
+ seriesData_long.to_csv(memfile, na_rep='null')
90
89
 
91
90
  res = apiManager.upload(url = '/path/' + pathId + '/vector/timestamp/' + timestampId + '/feature/series', filePath = 'upload', body= {'name':'upload'}, token = token, key = 'data', memfile= memfile)
92
91
  return res
93
92
  else:
94
- values = seriesData_long.to_dict('records')
93
+ seriesData_long = seriesData_long.replace({float('nan'): None})
95
94
 
95
+ values = seriesData_long.to_dict('records')
96
96
 
97
97
  chunks_values = chunks(values)
98
98
  N = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.46
3
+ Version: 3.1.48
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,16 +1,16 @@
1
- ellipsis/__init__.py,sha256=R6MNlybVTKLz0IBT7OihsOuFtHSwX6YvXctY1vI5LXg,210
2
- ellipsis/apiManager.py,sha256=JJ-1nT29BIcVSzMvEdkm1Wq6PsXT7Jq5OmJrRdg7C2o,5463
1
+ ellipsis/__init__.py,sha256=KwTCnOXo6LwHgK67wjnduQDCLwIlXztMDJs1-tCnAWg,210
2
+ ellipsis/apiManager.py,sha256=iU8HoHycJSDowyjiSqAMaqRY1MgoaPWwFeYCiJfzaaE,5573
3
3
  ellipsis/sanitize.py,sha256=T5FawJRZ2eqGv0itiMkZ1fuJpahsSyhBMFty9cG-wwA,10194
4
4
  ellipsis/account/__init__.py,sha256=K40DMBaUDSxt3rO2WZv63Wmpfy49ocqBxvWqyIYHR24,92
5
5
  ellipsis/account/root.py,sha256=tgGAT2BzP3zgAqsevvkeognn5S67T-MrIP52BLN9rbE,1791
6
6
  ellipsis/account/accessToken/__init__.py,sha256=ivwhK1eC4g74PAKaeTReb1QhIpKXyvmfdqZV6wDY-EY,66
7
7
  ellipsis/account/accessToken/root.py,sha256=TYo8wTyWyzytaqOTsuQC-Vn3y7BhYMC88EItZafpISA,1281
8
- ellipsis/path/__init__.py,sha256=cc03CEyQvWmdaFPo4T8KBeyYiz-04VtzcCDwMrHADmU,470
9
- ellipsis/path/root.py,sha256=3HaKJhjAeHMqK1rBjcvT92aG6kBWllpu3prUqO3Ov6s,8618
8
+ ellipsis/path/__init__.py,sha256=NzdcTpXpicdrBWLgsFP6WY7ARIBKUFnkwa5VuB1Qdpc,506
9
+ ellipsis/path/root.py,sha256=GqiYjAkdSchkQf1NzcSFZvBrmoQir7K2fqmZosqghFM,7953
10
10
  ellipsis/path/bookmark/__init__.py,sha256=vNrqGcWl5MN_xVAiClP6W6NilmsV-fqYOnJukbYcNwc,56
11
11
  ellipsis/path/bookmark/root.py,sha256=knhVIVAJS0jBT6JLdVgnufVRdxIR0VZBYfv292hg6xY,1285
12
12
  ellipsis/path/file/__init__.py,sha256=i_KB1S1J9pZjcPTKdyGMnjJf2tCoHFzptLGaxmTi55A,107
13
- ellipsis/path/file/root.py,sha256=3aqUFHQ7JLZf2arFoxOruOEKU-yOqUooj_LexGdPZ_s,4418
13
+ ellipsis/path/file/root.py,sha256=zY7Hc5hRZkSvRsHnjfYwTTBBLcg9sYhbuqvXP_yWjxk,4993
14
14
  ellipsis/path/folder/__init__.py,sha256=5keiFbsuXj5bYQHt8NahGkUYvXrJk8C7cQhgHA-4VBc,139
15
15
  ellipsis/path/folder/root.py,sha256=OJSaOLWPQDXXty5sxsG_G0Fiip0VdWzj_XrcxY9Gnj8,1913
16
16
  ellipsis/path/hashtag/__init__.py,sha256=4u8VC7xOFJjuZ9K08yh6GsPn8YkYZ_24o_7viScUQlg,59
@@ -33,12 +33,14 @@ ellipsis/path/raster/root.py,sha256=-y0SEukHEYUDvyJyDI1x7gtcDm-Wum_Ze7ekSYJr6O4,
33
33
  ellipsis/path/raster/style/__init__.py,sha256=mxlqVtSd2dsKai3DAVQjtNsh2KnTrZVyF8loRwUNT7E,61
34
34
  ellipsis/path/raster/style/root.py,sha256=YFQlGTdgjpwXn4h0ug7LrQZFLmRp2bdJN71A0iqZRFo,1627
35
35
  ellipsis/path/raster/timestamp/__init__.py,sha256=brmFXg69CKRcWaAfPbxWfsvHvnn5q8GBQhVzUTVb4_w,842
36
- ellipsis/path/raster/timestamp/root.py,sha256=qhJALjYVCdNmH3atGNmIe89Zm5xj_EAd8fczHWW4CQg,17257
36
+ ellipsis/path/raster/timestamp/root.py,sha256=AVwrLIcyyK_1G90C3jLCWFSFxisv5bzIobdt5IHk5R0,17330
37
37
  ellipsis/path/raster/timestamp/util.py,sha256=eupFFSBp5CaTDIRg6DYnZnfWY61h81JZ7c15NdJ-j5E,2580
38
38
  ellipsis/path/raster/timestamp/file/__init__.py,sha256=Ln9_dQ4-PMwb5VP--Qh09IV5zmr-47RShpe0-f_NVh4,97
39
39
  ellipsis/path/raster/timestamp/file/root.py,sha256=KD8E64eZtS62C-WCl3BTeVjsc08BaLXpuLwxfbmnTLI,4545
40
40
  ellipsis/path/raster/timestamp/order/__init__.py,sha256=4YEK4XW9TM-HsjoFlFeyGMtI3OKX2VCXfb4NsTsugBo,74
41
41
  ellipsis/path/raster/timestamp/order/root.py,sha256=zWcfI_q9KlfevzyvwWY8ni27KCvOyAiaJvohVfasjXg,1176
42
+ ellipsis/path/setUpTask/__init__.py,sha256=oDyCMCPzSIlMfAFIXrkviBlYwbPOmsUa3B3beyXfm_o,76
43
+ ellipsis/path/setUpTask/root.py,sha256=ERmbcGvxyCcGSKeJDe3bdYke9Do4VK02o-aeTQ77swM,1766
42
44
  ellipsis/path/usage/__init__.py,sha256=2BHmLV9soOYDhyQFH2B86bBjmWXGsfuX4KneEBDo6O4,96
43
45
  ellipsis/path/usage/root.py,sha256=NAZCDHXHcN6kodU3EpbNwlWM3It60ewsGXt4LJ_enG0,1566
44
46
  ellipsis/path/vector/__init__.py,sha256=hIbJlp1kO_k2AhaFagUfd_We7taOBdD3K9n6lheWpYI,228
@@ -54,7 +56,7 @@ ellipsis/path/vector/timestamp/feature/root.py,sha256=Y_GiT1vBEvZxxvJdUvzhjGqYsf
54
56
  ellipsis/path/vector/timestamp/feature/message/__init__.py,sha256=XfX3MIa4RjpToFnxNyfxCKTvRlNtJFRQ44j31wDyhGc,100
55
57
  ellipsis/path/vector/timestamp/feature/message/root.py,sha256=isLzkITTiluKoIsH0PYT0K5Cr-LBzTA0TSE4-2tZU5M,3949
56
58
  ellipsis/path/vector/timestamp/feature/series/__init__.py,sha256=vPi57QdUPTEnQE31abgxzwWU3Gzu-Xxi3ZVD4z5MMwg,107
57
- ellipsis/path/vector/timestamp/feature/series/root.py,sha256=KCm28pQ8E6WREftuSi4wge_2QpojDW11b55j7_tG7Js,7519
59
+ ellipsis/path/vector/timestamp/feature/series/root.py,sha256=DEeX5noIHMQA-sNlyLnxiZEBBEs5Xpsnclv9Xfe6Uas,7605
58
60
  ellipsis/path/vector/timestamp/file/__init__.py,sha256=qJtOXI9MEv4KifDjMW3zUDKnef8PD69SQmgRc3wDShQ,73
59
61
  ellipsis/path/vector/timestamp/file/root.py,sha256=STswXCVZMtLmYceXKQsLKhyNmWzifDHp084mdS9fYLQ,4736
60
62
  ellipsis/path/vector/timestamp/order/__init__.py,sha256=w11nMYDQJzZJU_q8o7ApadV2EOdCX93gNkHZ7PO1gUo,74
@@ -63,8 +65,8 @@ ellipsis/user/__init__.py,sha256=um_b42pc2otFiQRGqMajcEtONQpC2ei4r-EY3j7bsfQ,43
63
65
  ellipsis/user/root.py,sha256=dsMK6wGBdeCmOd3YsbIv9cEcQ6tAiSGr0jmtBhQl5-0,484
64
66
  ellipsis/util/__init__.py,sha256=_sNBUXDKJVGffRyt93xdUrJ4gON651Sp-unr7LKVCEc,756
65
67
  ellipsis/util/root.py,sha256=Ts7DeaD_X7x-csmq5V2sa_hYrt1mCd59T7-NUQcWj3Y,23980
66
- ellipsis-3.1.46.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
67
- ellipsis-3.1.46.dist-info/METADATA,sha256=GD17VF-4T2g_Ff-HUy-02yXLnP6eT_YucVKjzYzBhzg,1823
68
- ellipsis-3.1.46.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
69
- ellipsis-3.1.46.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
70
- ellipsis-3.1.46.dist-info/RECORD,,
68
+ ellipsis-3.1.48.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
69
+ ellipsis-3.1.48.dist-info/METADATA,sha256=sdIfJZ4ddvKrElMJq-XraR859JmHykpGB_ai2HnPCW4,1823
70
+ ellipsis-3.1.48.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
71
+ ellipsis-3.1.48.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
72
+ ellipsis-3.1.48.dist-info/RECORD,,