frost-sta-client 1.1.39__tar.gz → 1.1.41__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.
Files changed (55) hide show
  1. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/PKG-INFO +11 -11
  2. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/README.md +10 -10
  3. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/__version__.py +1 -1
  4. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/multi_datastream.py +2 -2
  5. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/service/sensorthingsservice.py +19 -3
  6. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client.egg-info/PKG-INFO +11 -11
  7. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/LICENSE +0 -0
  8. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/__init__.py +0 -0
  9. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/__init__.py +0 -0
  10. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/actuator.py +0 -0
  11. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/base.py +0 -0
  12. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/datastream.py +0 -0
  13. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/features_of_interest.py +0 -0
  14. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/historical_location.py +0 -0
  15. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/location.py +0 -0
  16. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/multi_datastream.py +0 -0
  17. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/observation.py +0 -0
  18. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/observedproperty.py +0 -0
  19. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/sensor.py +0 -0
  20. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/task.py +0 -0
  21. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/tasking_capability.py +0 -0
  22. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/dao/thing.py +0 -0
  23. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/__init__.py +0 -0
  24. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/actuator.py +0 -0
  25. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/datastream.py +0 -0
  26. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/entity.py +0 -0
  27. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/ext/__init__.py +0 -0
  28. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/ext/data_array_document.py +0 -0
  29. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/ext/data_array_value.py +0 -0
  30. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/ext/entity_list.py +0 -0
  31. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/ext/entity_type.py +0 -0
  32. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/ext/unitofmeasurement.py +0 -0
  33. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/feature_of_interest.py +0 -0
  34. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/historical_location.py +0 -0
  35. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/location.py +0 -0
  36. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/observation.py +0 -0
  37. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/observedproperty.py +0 -0
  38. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/sensor.py +0 -0
  39. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/task.py +0 -0
  40. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/tasking_capability.py +0 -0
  41. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/model/thing.py +0 -0
  42. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/query/__init__.py +0 -0
  43. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/query/query.py +0 -0
  44. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/service/__init__.py +0 -0
  45. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/service/auth_handler.py +0 -0
  46. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client/utils.py +0 -0
  47. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client.egg-info/SOURCES.txt +0 -0
  48. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client.egg-info/dependency_links.txt +0 -0
  49. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client.egg-info/requires.txt +0 -0
  50. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/frost_sta_client.egg-info/top_level.txt +0 -0
  51. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/setup.cfg +0 -0
  52. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/setup.py +0 -0
  53. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/tests/test_entity_formatter.py +0 -0
  54. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/tests/test_entity_reader.py +0 -0
  55. {frost_sta_client-1.1.39 → frost_sta_client-1.1.41}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frost_sta_client
3
- Version: 1.1.39
3
+ Version: 1.1.41
4
4
  Summary: a client library to facilitate interaction with a FROST SensorThingsAPI Server
5
5
  Home-page: https://github.com/FraunhoferIOSB/FROST-Python-Client
6
6
  Author: Jonathan Vogl
@@ -27,14 +27,14 @@ identified by a URI.
27
27
 
28
28
  ### CRUD operations
29
29
  The source code below demonstrates the CRUD operations for Thing objects. Operations for other entities work similarly.
30
- ```
30
+ ```python
31
31
  import frost_sta_client as fsc
32
32
 
33
33
  url = "exampleserver.com/FROST-Server/v1.1"
34
34
  service = fsc.SensorThingsService(url)
35
35
  ```
36
36
  #### Creating Entities
37
- ```
37
+ ```python
38
38
  from geojson import Point
39
39
 
40
40
  point = Point((-115.81, 37.24))
@@ -49,7 +49,7 @@ service.create(thing)
49
49
  #### Querying Entities
50
50
  Queries to the FROST Server can be modified to include filters, selections or expansions. The return value is always
51
51
  an EntityList object, containing the parsed json response of the server.
52
- ```
52
+ ```python
53
53
  things_list = service.things().query().filter('id eq 1').list()
54
54
 
55
55
  for thing in things_list:
@@ -62,7 +62,7 @@ replaying to the request with the first chunk accompanied by the link to the nex
62
62
 
63
63
  The class `EntityList` implements the function `__iter__` and `__next__` which makes it capable of iterating
64
64
  through the entire list of entities, including the calls to all chunks.
65
- ```
65
+ ```python
66
66
  things_list = service.things().query().list()
67
67
 
68
68
  for thing in things_list:
@@ -71,7 +71,7 @@ for thing in things_list:
71
71
 
72
72
  In a case where only the current chunk is supposed to be iterated, the `entities` list can be used.
73
73
 
74
- ```
74
+ ```python
75
75
  things_list = service.things().query().top(20).list()
76
76
 
77
77
  for thing in things_list.entities:
@@ -81,7 +81,7 @@ for thing in things_list.entities:
81
81
  ### Queries to related entity lists
82
82
 
83
83
  For example the Observations of a given Datastream can be queried via
84
- ```
84
+ ```python
85
85
  datastream = service.datastreams().find(1)
86
86
  observations_list = datastream.get_observations().query().filter("result gt 10").list()
87
87
  ```
@@ -96,7 +96,7 @@ combination with a for-loop).
96
96
 
97
97
  The callback function is called with one argument, which is the current index of the iteration.
98
98
 
99
- ```
99
+ ```python
100
100
  def callback_func(loaded_entities):
101
101
  print("loaded {} entities!".format(loaded_entities))
102
102
 
@@ -112,13 +112,13 @@ DataArrays can be used to make the creation of Observations easier, because with
112
112
  has to be created.
113
113
 
114
114
  An example usage looks as follows:
115
- ```
115
+ ```python
116
116
  import frost_sta_client as fsc
117
117
 
118
118
  service = fsc.SensorThingsService("exampleserver.com/FROST-Server/v1.1")
119
119
  dav = fsc.model.ext.data_array_value.DataArrayValue()
120
120
  datastream = service.datastreams().find(1)
121
- foi = service.feature_of_interest().find(1)
121
+ foi = service.features_of_interest().find(1)
122
122
  components = {dav.Property.PHENOMENON_TIME, dav.Property.RESULT, dav.Property.FEATURE_OF_INTEREST}
123
123
  dav.components = components
124
124
  dav.datastream = datastream
@@ -127,7 +127,7 @@ An example usage looks as follows:
127
127
  datastream=datastream,
128
128
  feature_of_interest=foi)
129
129
  obs2 = fsc.Observation(result=5,
130
- phenomenon_time='2022-12-19T17:00:00Z',
130
+ phenomenon_time='2022-12-19T10:00:00Z/2022-12-19T11:00:00Z',
131
131
  datastream=datastream,
132
132
  feature_of_interest=foi)
133
133
  dav.add_observation(obs1)
@@ -15,14 +15,14 @@ identified by a URI.
15
15
 
16
16
  ### CRUD operations
17
17
  The source code below demonstrates the CRUD operations for Thing objects. Operations for other entities work similarly.
18
- ```
18
+ ```python
19
19
  import frost_sta_client as fsc
20
20
 
21
21
  url = "exampleserver.com/FROST-Server/v1.1"
22
22
  service = fsc.SensorThingsService(url)
23
23
  ```
24
24
  #### Creating Entities
25
- ```
25
+ ```python
26
26
  from geojson import Point
27
27
 
28
28
  point = Point((-115.81, 37.24))
@@ -37,7 +37,7 @@ service.create(thing)
37
37
  #### Querying Entities
38
38
  Queries to the FROST Server can be modified to include filters, selections or expansions. The return value is always
39
39
  an EntityList object, containing the parsed json response of the server.
40
- ```
40
+ ```python
41
41
  things_list = service.things().query().filter('id eq 1').list()
42
42
 
43
43
  for thing in things_list:
@@ -50,7 +50,7 @@ replaying to the request with the first chunk accompanied by the link to the nex
50
50
 
51
51
  The class `EntityList` implements the function `__iter__` and `__next__` which makes it capable of iterating
52
52
  through the entire list of entities, including the calls to all chunks.
53
- ```
53
+ ```python
54
54
  things_list = service.things().query().list()
55
55
 
56
56
  for thing in things_list:
@@ -59,7 +59,7 @@ for thing in things_list:
59
59
 
60
60
  In a case where only the current chunk is supposed to be iterated, the `entities` list can be used.
61
61
 
62
- ```
62
+ ```python
63
63
  things_list = service.things().query().top(20).list()
64
64
 
65
65
  for thing in things_list.entities:
@@ -69,7 +69,7 @@ for thing in things_list.entities:
69
69
  ### Queries to related entity lists
70
70
 
71
71
  For example the Observations of a given Datastream can be queried via
72
- ```
72
+ ```python
73
73
  datastream = service.datastreams().find(1)
74
74
  observations_list = datastream.get_observations().query().filter("result gt 10").list()
75
75
  ```
@@ -84,7 +84,7 @@ combination with a for-loop).
84
84
 
85
85
  The callback function is called with one argument, which is the current index of the iteration.
86
86
 
87
- ```
87
+ ```python
88
88
  def callback_func(loaded_entities):
89
89
  print("loaded {} entities!".format(loaded_entities))
90
90
 
@@ -100,13 +100,13 @@ DataArrays can be used to make the creation of Observations easier, because with
100
100
  has to be created.
101
101
 
102
102
  An example usage looks as follows:
103
- ```
103
+ ```python
104
104
  import frost_sta_client as fsc
105
105
 
106
106
  service = fsc.SensorThingsService("exampleserver.com/FROST-Server/v1.1")
107
107
  dav = fsc.model.ext.data_array_value.DataArrayValue()
108
108
  datastream = service.datastreams().find(1)
109
- foi = service.feature_of_interest().find(1)
109
+ foi = service.features_of_interest().find(1)
110
110
  components = {dav.Property.PHENOMENON_TIME, dav.Property.RESULT, dav.Property.FEATURE_OF_INTEREST}
111
111
  dav.components = components
112
112
  dav.datastream = datastream
@@ -115,7 +115,7 @@ An example usage looks as follows:
115
115
  datastream=datastream,
116
116
  feature_of_interest=foi)
117
117
  obs2 = fsc.Observation(result=5,
118
- phenomenon_time='2022-12-19T17:00:00Z',
118
+ phenomenon_time='2022-12-19T10:00:00Z/2022-12-19T11:00:00Z',
119
119
  datastream=datastream,
120
120
  feature_of_interest=foi)
121
121
  dav.add_observation(obs1)
@@ -1,5 +1,5 @@
1
1
  __title__ = 'frost_sta_client'
2
- __version__ = '1.1.39'
2
+ __version__ = '1.1.41'
3
3
  __license__ = 'LGPL3'
4
4
  __author__ = 'Jonathan Vogl'
5
5
  __copyright__ = 'Fraunhofer IOSB'
@@ -345,5 +345,5 @@ class MultiDatastream(entity.Entity):
345
345
  self.observed_properties.next_link = state.get('Observations@iot.nextLink')
346
346
  self.observed_properties.count = state.get('Observations@iot.count')
347
347
 
348
- def get_dao(self):
349
- return MultiDatastreamDao(self)
348
+ def get_dao(self, service):
349
+ return MultiDatastreamDao(service)
@@ -25,9 +25,10 @@ from frost_sta_client.model.ext import entity_type
25
25
 
26
26
  class SensorThingsService:
27
27
 
28
- def __init__(self, url, auth_handler=None):
28
+ def __init__(self, url, auth_handler=None, proxies=None):
29
29
  self.url = url
30
30
  self.auth_handler = auth_handler
31
+ self.proxies = proxies
31
32
 
32
33
  @property
33
34
  def url(self):
@@ -58,11 +59,26 @@ class SensorThingsService:
58
59
  raise ValueError('auth should be of type AuthHandler!')
59
60
  self._auth_handler = value
60
61
 
62
+
63
+ @property
64
+ def proxies(self):
65
+ return self._proxies
66
+
67
+ @proxies.setter
68
+ def proxies(self, value):
69
+ if value is None:
70
+ self._proxies = None
71
+ return
72
+ elif not isinstance(value, dict):
73
+ raise ValueError('Proxies must be a Dictionary!')
74
+ self._proxies = value
75
+
76
+
61
77
  def execute(self, method, url, **kwargs):
62
78
  if self.auth_handler is not None:
63
- response = requests.request(method, url, auth=self.auth_handler.add_auth_header(), **kwargs)
79
+ response = requests.request(method, url, proxies=self.proxies, auth=self.auth_handler.add_auth_header(), **kwargs)
64
80
  else:
65
- response = requests.request(method, url, **kwargs)
81
+ response = requests.request(method, url, proxies=self.proxies, **kwargs)
66
82
  try:
67
83
  response.raise_for_status()
68
84
  except requests.exceptions.HTTPError as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frost-sta-client
3
- Version: 1.1.39
3
+ Version: 1.1.41
4
4
  Summary: a client library to facilitate interaction with a FROST SensorThingsAPI Server
5
5
  Home-page: https://github.com/FraunhoferIOSB/FROST-Python-Client
6
6
  Author: Jonathan Vogl
@@ -27,14 +27,14 @@ identified by a URI.
27
27
 
28
28
  ### CRUD operations
29
29
  The source code below demonstrates the CRUD operations for Thing objects. Operations for other entities work similarly.
30
- ```
30
+ ```python
31
31
  import frost_sta_client as fsc
32
32
 
33
33
  url = "exampleserver.com/FROST-Server/v1.1"
34
34
  service = fsc.SensorThingsService(url)
35
35
  ```
36
36
  #### Creating Entities
37
- ```
37
+ ```python
38
38
  from geojson import Point
39
39
 
40
40
  point = Point((-115.81, 37.24))
@@ -49,7 +49,7 @@ service.create(thing)
49
49
  #### Querying Entities
50
50
  Queries to the FROST Server can be modified to include filters, selections or expansions. The return value is always
51
51
  an EntityList object, containing the parsed json response of the server.
52
- ```
52
+ ```python
53
53
  things_list = service.things().query().filter('id eq 1').list()
54
54
 
55
55
  for thing in things_list:
@@ -62,7 +62,7 @@ replaying to the request with the first chunk accompanied by the link to the nex
62
62
 
63
63
  The class `EntityList` implements the function `__iter__` and `__next__` which makes it capable of iterating
64
64
  through the entire list of entities, including the calls to all chunks.
65
- ```
65
+ ```python
66
66
  things_list = service.things().query().list()
67
67
 
68
68
  for thing in things_list:
@@ -71,7 +71,7 @@ for thing in things_list:
71
71
 
72
72
  In a case where only the current chunk is supposed to be iterated, the `entities` list can be used.
73
73
 
74
- ```
74
+ ```python
75
75
  things_list = service.things().query().top(20).list()
76
76
 
77
77
  for thing in things_list.entities:
@@ -81,7 +81,7 @@ for thing in things_list.entities:
81
81
  ### Queries to related entity lists
82
82
 
83
83
  For example the Observations of a given Datastream can be queried via
84
- ```
84
+ ```python
85
85
  datastream = service.datastreams().find(1)
86
86
  observations_list = datastream.get_observations().query().filter("result gt 10").list()
87
87
  ```
@@ -96,7 +96,7 @@ combination with a for-loop).
96
96
 
97
97
  The callback function is called with one argument, which is the current index of the iteration.
98
98
 
99
- ```
99
+ ```python
100
100
  def callback_func(loaded_entities):
101
101
  print("loaded {} entities!".format(loaded_entities))
102
102
 
@@ -112,13 +112,13 @@ DataArrays can be used to make the creation of Observations easier, because with
112
112
  has to be created.
113
113
 
114
114
  An example usage looks as follows:
115
- ```
115
+ ```python
116
116
  import frost_sta_client as fsc
117
117
 
118
118
  service = fsc.SensorThingsService("exampleserver.com/FROST-Server/v1.1")
119
119
  dav = fsc.model.ext.data_array_value.DataArrayValue()
120
120
  datastream = service.datastreams().find(1)
121
- foi = service.feature_of_interest().find(1)
121
+ foi = service.features_of_interest().find(1)
122
122
  components = {dav.Property.PHENOMENON_TIME, dav.Property.RESULT, dav.Property.FEATURE_OF_INTEREST}
123
123
  dav.components = components
124
124
  dav.datastream = datastream
@@ -127,7 +127,7 @@ An example usage looks as follows:
127
127
  datastream=datastream,
128
128
  feature_of_interest=foi)
129
129
  obs2 = fsc.Observation(result=5,
130
- phenomenon_time='2022-12-19T17:00:00Z',
130
+ phenomenon_time='2022-12-19T10:00:00Z/2022-12-19T11:00:00Z',
131
131
  datastream=datastream,
132
132
  feature_of_interest=foi)
133
133
  dav.add_observation(obs1)