ellipsis 3.1.41__py3-none-any.whl → 3.1.43__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
@@ -7,7 +7,7 @@ from ellipsis import path
7
7
  from ellipsis import view
8
8
  from ellipsis import util
9
9
 
10
- __version__ = '3.1.41'
10
+ __version__ = '3.1.43'
11
11
 
12
12
 
13
13
 
ellipsis/apiManager.py CHANGED
@@ -2,6 +2,7 @@ import requests
2
2
  import json
3
3
  import urllib
4
4
  import os
5
+ import time
5
6
  from requests_toolbelt import MultipartEncoder
6
7
 
7
8
  baseUrl = 'https://api.ellipsis-drive.com/v3'
@@ -65,8 +66,36 @@ def delete(url, body, token = None):
65
66
  r = call( method = requests.delete, url = url, body = body, token = token )
66
67
  return r
67
68
 
68
-
69
+ RETRIES = 10
70
+ WAIT = 2
69
71
  def call(method, url, body = None, token = None, crash = True, parseJson = True):
72
+ tried = 0
73
+ while tried <RETRIES:
74
+ try:
75
+ r = actualCall(method, url, body, token)
76
+ break
77
+ except:
78
+ print('time out detected, retrying request')
79
+ time.sleep(WAIT)
80
+ tried = tried +1
81
+ if tried >= RETRIES:
82
+ raise ValueError('Could not reach server')
83
+ if crash:
84
+ if r.status_code != 200:
85
+ raise ValueError(r.text)
86
+
87
+ if parseJson:
88
+ try:
89
+ r = r.json()
90
+ except:
91
+ r = r.text
92
+
93
+ return r
94
+ else:
95
+ return r
96
+
97
+ TIMEOUTTIME = 10
98
+ def actualCall(method, url, body, token):
70
99
  body = filterNone(body)
71
100
  if type(body) != type(None) and type(body) != type({}):
72
101
  raise ValueError(
@@ -76,26 +105,13 @@ def call(method, url, body = None, token = None, crash = True, parseJson = True)
76
105
  raise ValueError('Token must be of type string or noneType')
77
106
 
78
107
  if token == None:
79
- r = method(baseUrl + url, json=body)
108
+ r = method(baseUrl + url, json=body, timeout=TIMEOUTTIME)
80
109
  else:
81
110
  if not 'Bearer' in token:
82
111
  token = 'Bearer ' + token
83
- r = method(baseUrl + url , json = body, headers = {"Authorization":token})
84
-
85
- if crash:
86
- if r.status_code != 200:
87
- raise ValueError(r.text)
88
-
89
- if parseJson:
90
- try:
91
- r = r.json()
92
- except:
93
- r = r.text
94
-
95
- return r
96
- else:
97
- return r
112
+ r = method(baseUrl + url, json=body, headers={"Authorization": token}, timeout=TIMEOUTTIME)
98
113
 
114
+ return r
99
115
 
100
116
  def upload(url, filePath, body, token, key = 'data', memfile= None):
101
117
  body = filterNone(body, toString=True)
@@ -12,7 +12,7 @@ def add(pathId, timestampId, token, extent = None, fileFormat = 'geojson'):
12
12
  pathId = sanitize.validUuid('pathId', pathId, True)
13
13
  timestampId = sanitize.validUuid('timestampId', timestampId, True)
14
14
  extent = sanitize.validBounds('extent', extent, False)
15
- token = sanitize.validString('fileFormat', fileFormat, True)
15
+ fileFormat = sanitize.validString('fileFormat', fileFormat, True)
16
16
 
17
17
 
18
18
  body = { 'extent':extent, 'format' :fileFormat}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.41
3
+ Version: 3.1.43
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,5 +1,5 @@
1
- ellipsis/__init__.py,sha256=LHAlCLDYAL0nyapVVzZ7AuToFdbhZWqN__DgFxfYkhg,236
2
- ellipsis/apiManager.py,sha256=W1xTId1ZIDOaFN4NVcyGoxGC4HeI5CIabY4FyGz__7M,5027
1
+ ellipsis/__init__.py,sha256=hwn8DtT6nLrwlH8pbEUxoG8aWix5UfD8tLpnwPH_hho,236
2
+ ellipsis/apiManager.py,sha256=hfe-pESfrljoY9Q_86G1kDYbBW9i3_xMNmh5zN0jRd0,5485
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
@@ -56,15 +56,15 @@ ellipsis/path/vector/timestamp/feature/series/root.py,sha256=KCm28pQ8E6WREftuSi4
56
56
  ellipsis/path/vector/timestamp/file/__init__.py,sha256=qJtOXI9MEv4KifDjMW3zUDKnef8PD69SQmgRc3wDShQ,73
57
57
  ellipsis/path/vector/timestamp/file/root.py,sha256=UPmcyJ4oWsOpDrsiM-sM5wtXGwkijKSIXLqpnQd4icA,4132
58
58
  ellipsis/path/vector/timestamp/order/__init__.py,sha256=w11nMYDQJzZJU_q8o7ApadV2EOdCX93gNkHZ7PO1gUo,74
59
- ellipsis/path/vector/timestamp/order/root.py,sha256=Mke16gxwK4qJDtSMqt5DRkOtLFqZyZGU8bjN_8uBjoA,1169
59
+ ellipsis/path/vector/timestamp/order/root.py,sha256=F0j2niJ73jRUposYNuviKFDOutlS-TECfk6O1slLW4c,1174
60
60
  ellipsis/user/__init__.py,sha256=um_b42pc2otFiQRGqMajcEtONQpC2ei4r-EY3j7bsfQ,43
61
61
  ellipsis/user/root.py,sha256=dsMK6wGBdeCmOd3YsbIv9cEcQ6tAiSGr0jmtBhQl5-0,484
62
62
  ellipsis/util/__init__.py,sha256=G0LaqqipkJXqZZnW78pqOw-gDQWZYLMa2ioLoCac-NI,714
63
63
  ellipsis/util/root.py,sha256=keGn515Dnxyja8kNG9p-xdsX6gRa8pHCh6AJaQXLoig,23445
64
64
  ellipsis/view/__init__.py,sha256=91KyJzbSvwSP9hvJQyo1LLM48b5NixLz6G40I9h6sdY,67
65
65
  ellipsis/view/root.py,sha256=6actiBwIsM0f7sJhQl_U4j-C6Dhe0z5XGGtxIOIKdY8,1726
66
- ellipsis-3.1.41.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
67
- ellipsis-3.1.41.dist-info/METADATA,sha256=Jc7Y4pM9kyaMjMDaxzmhfVDeubwi3xzxrHCYJT8GhvU,1823
68
- ellipsis-3.1.41.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
69
- ellipsis-3.1.41.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
70
- ellipsis-3.1.41.dist-info/RECORD,,
66
+ ellipsis-3.1.43.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
67
+ ellipsis-3.1.43.dist-info/METADATA,sha256=YvBY9loQarcjjz1Gt4eeTRGhO8RkDKMIGN7UNu7LI5Q,1823
68
+ ellipsis-3.1.43.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
69
+ ellipsis-3.1.43.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
70
+ ellipsis-3.1.43.dist-info/RECORD,,