ellipsis 3.1.6__tar.gz → 3.1.8__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.

Potentially problematic release.


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

Files changed (68) hide show
  1. {ellipsis-3.1.6 → ellipsis-3.1.8}/PKG-INFO +1 -5
  2. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/__init__.py +1 -1
  3. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/apiManager.py +22 -9
  4. ellipsis-3.1.8/ellipsis/path/file/__init__.py +2 -0
  5. ellipsis-3.1.8/ellipsis/path/file/root.py +146 -0
  6. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/sanitize.py +6 -0
  7. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis.egg-info/PKG-INFO +1 -5
  8. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis.egg-info/requires.txt +8 -8
  9. {ellipsis-3.1.6 → ellipsis-3.1.8}/setup.py +3 -3
  10. {ellipsis-3.1.6 → ellipsis-3.1.8}/test/test.py +4 -1
  11. ellipsis-3.1.6/ellipsis/path/file/__init__.py +0 -2
  12. ellipsis-3.1.6/ellipsis/path/file/root.py +0 -25
  13. {ellipsis-3.1.6 → ellipsis-3.1.8}/LICENSE +0 -0
  14. {ellipsis-3.1.6 → ellipsis-3.1.8}/README.md +0 -0
  15. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/account/__init__.py +0 -0
  16. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/account/accessToken/__init__.py +0 -0
  17. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/account/accessToken/root.py +0 -0
  18. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/account/root.py +0 -0
  19. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/__init__.py +0 -0
  20. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/folder/__init__.py +0 -0
  21. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/folder/root.py +0 -0
  22. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/hashtag/__init__.py +0 -0
  23. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/hashtag/root.py +0 -0
  24. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/invite/__init__.py +0 -0
  25. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/invite/root.py +0 -0
  26. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/member/__init__.py +0 -0
  27. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/member/root.py +0 -0
  28. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/__init__.py +0 -0
  29. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/root.py +0 -0
  30. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/style/__init__.py +0 -0
  31. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/style/root.py +0 -0
  32. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/timestamp/__init__.py +0 -0
  33. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/timestamp/file/__init__.py +0 -0
  34. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/timestamp/file/root.py +0 -0
  35. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/timestamp/order/__init__.py +0 -0
  36. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/timestamp/order/root.py +0 -0
  37. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/raster/timestamp/root.py +0 -0
  38. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/root.py +0 -0
  39. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/usage/__init__.py +0 -0
  40. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/usage/root.py +0 -0
  41. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/__init__.py +0 -0
  42. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/featureProperty/__init__.py +0 -0
  43. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/featureProperty/root.py +0 -0
  44. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/root.py +0 -0
  45. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/style/__init__.py +0 -0
  46. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/style/root.py +0 -0
  47. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/__init__.py +0 -0
  48. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/feature/__init__.py +0 -0
  49. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/feature/message/__init__.py +0 -0
  50. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/feature/message/root.py +0 -0
  51. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/feature/root.py +0 -0
  52. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/feature/series/__init__.py +0 -0
  53. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/feature/series/root.py +0 -0
  54. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/file/__init__.py +0 -0
  55. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/file/root.py +0 -0
  56. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/order/__init__.py +0 -0
  57. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/order/root.py +0 -0
  58. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/path/vector/timestamp/root.py +0 -0
  59. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/user/__init__.py +0 -0
  60. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/user/root.py +0 -0
  61. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/util/__init__.py +0 -0
  62. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/util/root.py +0 -0
  63. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/view/__init__.py +0 -0
  64. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis/view/root.py +0 -0
  65. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis.egg-info/SOURCES.txt +0 -0
  66. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis.egg-info/dependency_links.txt +0 -0
  67. {ellipsis-3.1.6 → ellipsis-3.1.8}/ellipsis.egg-info/top_level.txt +0 -0
  68. {ellipsis-3.1.6 → ellipsis-3.1.8}/setup.cfg +0 -0
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.6
3
+ Version: 3.1.8
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
7
7
  Author-email: daniel@ellipsis-drive.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
8
  Classifier: Programming Language :: Python :: 3
11
9
  Classifier: License :: OSI Approved :: MIT License
12
10
  Classifier: Operating System :: OS Independent
@@ -50,5 +48,3 @@ Another example
50
48
  info = el.path.get(folderId, token)
51
49
  layers = el.path.listPath(folderId, pathType='layer', token = token, listAll = True)
52
50
  folders = el.path.listPath(folderId, pathType='folder', token = token, listAll = True)
53
-
54
-
@@ -7,4 +7,4 @@ from ellipsis import path
7
7
  from ellipsis import view
8
8
  from ellipsis import util
9
9
 
10
- __version__ = '3.1.6'
10
+ __version__ = '3.1.8'
@@ -89,39 +89,52 @@ def call(method, url, body = None, token = None, crash = True):
89
89
  return r
90
90
 
91
91
 
92
- def upload(url, filePath, body, token, key = 'data'):
92
+ def upload(url, filePath, body, token, key = 'data', memfile= None):
93
93
  body = filterNone(body)
94
-
95
94
  seperator = os.path.sep
96
95
  fileName = filePath.split(seperator)[len(filePath.split(seperator))-1 ]
96
+
97
+ if str(type(memfile)) == str(type(None)):
98
+ conn_file = open(filePath, 'rb')
99
+ else:
100
+ conn_file = memfile
101
+
102
+ payload = MultipartEncoder(fields = {**body, key: (fileName, conn_file, 'application/octet-stream')})
103
+
97
104
 
98
105
  for k in body.keys():
99
106
  body[k] = str(body[k])
100
107
 
101
- conn_file = open(filePath, 'rb')
102
-
103
- payload = MultipartEncoder(fields = {**body, key: (fileName, conn_file, 'application/octet-stream')})
104
108
 
105
109
  token = 'Bearer ' + token
106
110
 
107
111
  r = requests.post(baseUrl + url, headers = {"Authorization":token, "Content-Type": payload.content_type}, data=payload)
108
- conn_file.close()
112
+
113
+ if str(type(memfile)) == str(type(None)):
114
+ conn_file.close()
109
115
 
110
116
  if r.status_code != 200:
111
117
  raise ValueError(r.text)
112
118
  return r.json()
113
119
 
114
- def download(url, filePath, token):
120
+ def download(url, filePath, token, memfile = None):
115
121
 
116
122
  token = 'Bearer ' + token
117
123
  with requests.get(baseUrl + url, stream=True, headers={"Authorization": token}) as r:
118
124
  r.raise_for_status()
119
- with open(filePath, 'wb') as f:
125
+ if str(type(memfile)) == str(type(None)):
126
+ with open(filePath, 'wb') as f:
127
+ for chunk in r.iter_content(chunk_size=8192):
128
+ # If you have chunk encoded response uncomment if
129
+ # and set chunk_size parameter to None.
130
+ #if chunk:
131
+ f.write(chunk)
132
+ else:
120
133
  for chunk in r.iter_content(chunk_size=8192):
121
134
  # If you have chunk encoded response uncomment if
122
135
  # and set chunk_size parameter to None.
123
136
  #if chunk:
124
- f.write(chunk)
137
+ memfile.write(chunk)
125
138
 
126
139
 
127
140
 
@@ -0,0 +1,2 @@
1
+ from ellipsis.path.file.root import download, add, addPickle, getPickle, addCsv, getCsv, addJson, getJson
2
+
@@ -0,0 +1,146 @@
1
+ from ellipsis import apiManager
2
+ from ellipsis import sanitize
3
+
4
+ import os
5
+ import pickle
6
+ from io import BytesIO
7
+ import json
8
+ import pandas as pd
9
+
10
+
11
+ def add( filePath, token, parentId = None, publicAccess =None, metadata=None):
12
+ token = sanitize.validString('token', token, True)
13
+ parentId = sanitize.validUuid('parentId', parentId, False)
14
+ publicAccess = sanitize.validObject('publicAccess', publicAccess, False)
15
+ metadata = sanitize.validObject('metadata', metadata, False)
16
+
17
+
18
+
19
+ seperator = os.path.sep
20
+ fileName = filePath.split(seperator)[len(filePath.split(seperator))-1 ]
21
+
22
+ body = {'name':fileName, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
23
+ r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
24
+ return r
25
+
26
+
27
+ def download(pathId, filePath, token=None):
28
+ pathId = sanitize.validUuid('pathId', pathId, True)
29
+ token = sanitize.validString('token', token, False)
30
+ filePath = sanitize.validString('filePath', filePath, True)
31
+
32
+
33
+ apiManager.download('/path/' + pathId + '/file/data', filePath, token)
34
+
35
+
36
+
37
+ def addCsv(df, name, token, parentId = None, publicAccess =None, metadata=None):
38
+ token = sanitize.validString('token', token, True)
39
+ name = sanitize.validString('name', name, True)
40
+ df = sanitize.validPandas('df', df, True)
41
+
42
+ parentId = sanitize.validUuid('parentId', parentId, False)
43
+ publicAccess = sanitize.validObject('publicAccess', publicAccess, False)
44
+ metadata = sanitize.validObject('metadata', metadata, False)
45
+
46
+ memfile = BytesIO()
47
+ df.to_csv(memfile)
48
+
49
+
50
+ body = {'name':name, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
51
+ r = apiManager.upload('/path/file' , name, body, token, key='data', memfile = memfile)
52
+
53
+
54
+ return r
55
+
56
+ def getCsv(pathId, token=None):
57
+ pathId = sanitize.validUuid('pathId', pathId, True)
58
+ token = sanitize.validString('token', token, False)
59
+
60
+
61
+ r = apiManager.get('/path/' + pathId + '/file/data', {}, token)
62
+
63
+
64
+ memfile = BytesIO(bytes(r, 'utf-8'))
65
+ try:
66
+ df = pd.read_csv(memfile)
67
+ except:
68
+ raise ValueError('Read file is not a valid CSV')
69
+ return df
70
+
71
+
72
+
73
+ def addJson(d, name, token, parentId = None, publicAccess =None, metadata=None):
74
+ token = sanitize.validString('token', token, True)
75
+ name = sanitize.validString('name', name, True)
76
+ d = sanitize.validObject('d', d, True)
77
+
78
+ parentId = sanitize.validUuid('parentId', parentId, False)
79
+ publicAccess = sanitize.validObject('publicAccess', publicAccess, False)
80
+ metadata = sanitize.validObject('metadata', metadata, False)
81
+
82
+ memfile = BytesIO()
83
+ d = json.dumps(d)
84
+ memfile.write(bytes(d, 'utf-8'))
85
+
86
+
87
+ body = {'name':name, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
88
+ r = apiManager.upload('/path/file' , name, body, token, key='data', memfile = memfile)
89
+
90
+
91
+ return r
92
+
93
+
94
+ def getJson(pathId, token=None):
95
+ pathId = sanitize.validUuid('pathId', pathId, True)
96
+ token = sanitize.validString('token', token, False)
97
+
98
+ memfile = BytesIO()
99
+ apiManager.download('/path/' + pathId + '/file/data', '', token, memfile)
100
+ memfile.seek(0)
101
+ try:
102
+ x = json.load(memfile)
103
+ except:
104
+ raise ValueError('Read file not a valid pickle file')
105
+
106
+
107
+ return x
108
+
109
+
110
+
111
+ def addPickle(x, name, token, parentId = None, publicAccess =None, metadata=None):
112
+ token = sanitize.validString('token', token, True)
113
+ name = sanitize.validString('name', name, True)
114
+ parentId = sanitize.validUuid('parentId', parentId, False)
115
+ publicAccess = sanitize.validObject('publicAccess', publicAccess, False)
116
+ metadata = sanitize.validObject('metadata', metadata, False)
117
+
118
+ memfile = BytesIO()
119
+ pickle.dump(x, memfile)
120
+
121
+ body = {'name':name, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
122
+ r = apiManager.upload('/path/file' , name, body, token, key='data', memfile = memfile)
123
+
124
+ return r
125
+
126
+
127
+ def getPickle(pathId, token=None):
128
+ pathId = sanitize.validUuid('pathId', pathId, True)
129
+ token = sanitize.validString('token', token, False)
130
+
131
+ memfile = BytesIO()
132
+ apiManager.download('/path/' + pathId + '/file/data', '', token, memfile)
133
+ memfile.seek(0)
134
+ try:
135
+ x = pickle.load(memfile)
136
+ except:
137
+ raise ValueError('Read file not a valid pickle file')
138
+
139
+
140
+ return x
141
+
142
+
143
+
144
+
145
+
146
+
@@ -68,7 +68,13 @@ def validUuidArray(name, value, required):
68
68
  raise ValueError(name + ' must be a list of uuids')
69
69
  return(value)
70
70
 
71
+ def validPandas(name, value, required):
72
+ if not required and type(value) == type(None):
73
+ return
71
74
 
75
+ if type(value) != type(pd.DataFrame()):
76
+ raise ValueError(name + 'must be of type pandas data frame')
77
+ return(value)
72
78
 
73
79
  def validString(name, value, required):
74
80
  if not required and type(value) == type(None):
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.6
3
+ Version: 3.1.8
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
7
7
  Author-email: daniel@ellipsis-drive.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
8
  Classifier: Programming Language :: Python :: 3
11
9
  Classifier: License :: OSI Approved :: MIT License
12
10
  Classifier: Operating System :: OS Independent
@@ -50,5 +48,3 @@ Another example
50
48
  info = el.path.get(folderId, token)
51
49
  layers = el.path.listPath(folderId, pathType='layer', token = token, listAll = True)
52
50
  folders = el.path.listPath(folderId, pathType='folder', token = token, listAll = True)
53
-
54
-
@@ -1,14 +1,14 @@
1
- Fiona
1
+ pandas
2
2
  Pillow
3
- Shapely
4
- geopandas==0.9.0
5
- geopy
6
- imagecodecs
3
+ geopandas
4
+ pyproj
7
5
  numpy
8
- pandas
9
- pyproj==3.0.1
10
- rasterio
6
+ imagecodecs
11
7
  requests
12
8
  requests-toolbelt
9
+ rasterio
10
+ Shapely
11
+ geopy
13
12
  scikit-image
13
+ Fiona
14
14
  tifffile
@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
6
6
 
7
7
  setuptools.setup(
8
8
  name="ellipsis",
9
- version="3.1.6",
9
+ version="3.1.8",
10
10
  author="Daniel van der Maas",
11
11
  author_email="daniel@ellipsis-drive.com",
12
12
  description="Package to interact with the Ellipsis API",
@@ -22,8 +22,8 @@ setuptools.setup(
22
22
  install_requires=[
23
23
  'pandas',
24
24
  'Pillow',
25
- 'geopandas==0.9.0',
26
- 'pyproj==3.0.1',
25
+ 'geopandas',
26
+ 'pyproj',
27
27
  'numpy',
28
28
  'imagecodecs',
29
29
  'requests',
@@ -24,7 +24,7 @@ folderId = '46e1e919-8b73-42a3-a575-25c6d45fd93b'
24
24
 
25
25
 
26
26
  ##account
27
- demo_token = el.account.logIn("demo_user", "")
27
+ demo_token = el.account.logIn("demo_user", "demo_user")
28
28
  admin_token = el.account.logIn(username = 'admin', password='')
29
29
  daan_token = el.account.logIn('daan', "")
30
30
 
@@ -45,6 +45,9 @@ r_file = el.path.searchFile(token=token);
45
45
  filePath = '/home/daniel/Ellipsis/db/testset/0.tif'
46
46
  pathId = el.path.file.add(filePath, token)['id']
47
47
  el.path.file.download(pathId = pathId, filePath = '/home/daniel/Downloads/out.tif')
48
+ el.path.trash(pathId, token)
49
+ el.path.delete(pathId, token)
50
+
48
51
 
49
52
  ##user
50
53
 
@@ -1,2 +0,0 @@
1
- from ellipsis.path.file.root import download
2
- from ellipsis.path.file.root import add
@@ -1,25 +0,0 @@
1
- from ellipsis import apiManager
2
- from ellipsis import sanitize
3
-
4
- import os
5
-
6
-
7
- def download(pathId, filePath, token=None):
8
- pathId = sanitize.validUuid('pathId', pathId, True)
9
- token = sanitize.validString('token', token, False)
10
- filePath = sanitize.validString('filePath', filePath, True)
11
-
12
-
13
- apiManager.download('/path/' + pathId + '/file/data', filePath, token)
14
-
15
-
16
-
17
- def add( filePath, token, parentId = None, publicAccess =None, metadata=None):
18
- token = sanitize.validString('token', token, True)
19
-
20
- seperator = os.path.sep
21
- fileName = filePath.split(seperator)[len(filePath.split(seperator))-1 ]
22
-
23
- body = {'name':fileName, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
24
- r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
25
- return r
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes