geobox 2.0__tar.gz → 2.0.1__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 (101) hide show
  1. {geobox-2.0.0 → geobox-2.0.1}/PKG-INFO +1 -1
  2. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/api.py +2 -2
  3. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/query.py +0 -9
  4. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/usage.py +1 -1
  5. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/workflow.py +1 -1
  6. {geobox-2.0.0 → geobox-2.0.1}/geobox/api.py +2 -4
  7. {geobox-2.0.0 → geobox-2.0.1}/geobox/query.py +1 -10
  8. {geobox-2.0.0 → geobox-2.0.1}/geobox/view.py +2 -2
  9. {geobox-2.0.0 → geobox-2.0.1}/geobox.egg-info/PKG-INFO +1 -1
  10. {geobox-2.0.0 → geobox-2.0.1}/pyproject.toml +1 -1
  11. {geobox-2.0.0 → geobox-2.0.1}/tests/test_query.py +0 -35
  12. {geobox-2.0.0 → geobox-2.0.1}/LICENSE +0 -0
  13. {geobox-2.0.0 → geobox-2.0.1}/README.md +0 -0
  14. {geobox-2.0.0 → geobox-2.0.1}/geobox/__init__.py +0 -0
  15. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/__init__.py +0 -0
  16. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/apikey.py +0 -0
  17. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/attachment.py +0 -0
  18. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/base.py +0 -0
  19. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/basemap.py +0 -0
  20. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/dashboard.py +0 -0
  21. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/feature.py +0 -0
  22. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/field.py +0 -0
  23. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/file.py +0 -0
  24. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/layout.py +0 -0
  25. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/log.py +0 -0
  26. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/map.py +0 -0
  27. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/model3d.py +0 -0
  28. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/mosaic.py +0 -0
  29. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/plan.py +0 -0
  30. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/raster.py +0 -0
  31. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/route.py +0 -0
  32. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/scene.py +0 -0
  33. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/settings.py +0 -0
  34. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/task.py +0 -0
  35. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/tile3d.py +0 -0
  36. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/tileset.py +0 -0
  37. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/user.py +0 -0
  38. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/vectorlayer.py +0 -0
  39. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/version.py +0 -0
  40. {geobox-2.0.0 → geobox-2.0.1}/geobox/aio/view.py +0 -0
  41. {geobox-2.0.0 → geobox-2.0.1}/geobox/apikey.py +0 -0
  42. {geobox-2.0.0 → geobox-2.0.1}/geobox/attachment.py +0 -0
  43. {geobox-2.0.0 → geobox-2.0.1}/geobox/base.py +0 -0
  44. {geobox-2.0.0 → geobox-2.0.1}/geobox/basemap.py +0 -0
  45. {geobox-2.0.0 → geobox-2.0.1}/geobox/dashboard.py +0 -0
  46. {geobox-2.0.0 → geobox-2.0.1}/geobox/enums.py +0 -0
  47. {geobox-2.0.0 → geobox-2.0.1}/geobox/exception.py +0 -0
  48. {geobox-2.0.0 → geobox-2.0.1}/geobox/feature.py +0 -0
  49. {geobox-2.0.0 → geobox-2.0.1}/geobox/field.py +0 -0
  50. {geobox-2.0.0 → geobox-2.0.1}/geobox/file.py +0 -0
  51. {geobox-2.0.0 → geobox-2.0.1}/geobox/layout.py +0 -0
  52. {geobox-2.0.0 → geobox-2.0.1}/geobox/log.py +0 -0
  53. {geobox-2.0.0 → geobox-2.0.1}/geobox/map.py +0 -0
  54. {geobox-2.0.0 → geobox-2.0.1}/geobox/model3d.py +0 -0
  55. {geobox-2.0.0 → geobox-2.0.1}/geobox/mosaic.py +0 -0
  56. {geobox-2.0.0 → geobox-2.0.1}/geobox/plan.py +0 -0
  57. {geobox-2.0.0 → geobox-2.0.1}/geobox/raster.py +0 -0
  58. {geobox-2.0.0 → geobox-2.0.1}/geobox/route.py +0 -0
  59. {geobox-2.0.0 → geobox-2.0.1}/geobox/scene.py +0 -0
  60. {geobox-2.0.0 → geobox-2.0.1}/geobox/settings.py +0 -0
  61. {geobox-2.0.0 → geobox-2.0.1}/geobox/task.py +0 -0
  62. {geobox-2.0.0 → geobox-2.0.1}/geobox/tile3d.py +0 -0
  63. {geobox-2.0.0 → geobox-2.0.1}/geobox/tileset.py +0 -0
  64. {geobox-2.0.0 → geobox-2.0.1}/geobox/usage.py +0 -0
  65. {geobox-2.0.0 → geobox-2.0.1}/geobox/user.py +0 -0
  66. {geobox-2.0.0 → geobox-2.0.1}/geobox/utils.py +0 -0
  67. {geobox-2.0.0 → geobox-2.0.1}/geobox/vectorlayer.py +0 -0
  68. {geobox-2.0.0 → geobox-2.0.1}/geobox/version.py +0 -0
  69. {geobox-2.0.0 → geobox-2.0.1}/geobox/workflow.py +0 -0
  70. {geobox-2.0.0 → geobox-2.0.1}/geobox.egg-info/SOURCES.txt +0 -0
  71. {geobox-2.0.0 → geobox-2.0.1}/geobox.egg-info/dependency_links.txt +0 -0
  72. {geobox-2.0.0 → geobox-2.0.1}/geobox.egg-info/requires.txt +0 -0
  73. {geobox-2.0.0 → geobox-2.0.1}/geobox.egg-info/top_level.txt +0 -0
  74. {geobox-2.0.0 → geobox-2.0.1}/setup.cfg +0 -0
  75. {geobox-2.0.0 → geobox-2.0.1}/tests/test_api.py +0 -0
  76. {geobox-2.0.0 → geobox-2.0.1}/tests/test_apikey.py +0 -0
  77. {geobox-2.0.0 → geobox-2.0.1}/tests/test_attachment.py +0 -0
  78. {geobox-2.0.0 → geobox-2.0.1}/tests/test_basemap.py +0 -0
  79. {geobox-2.0.0 → geobox-2.0.1}/tests/test_dashboard.py +0 -0
  80. {geobox-2.0.0 → geobox-2.0.1}/tests/test_feature.py +0 -0
  81. {geobox-2.0.0 → geobox-2.0.1}/tests/test_field.py +0 -0
  82. {geobox-2.0.0 → geobox-2.0.1}/tests/test_file.py +0 -0
  83. {geobox-2.0.0 → geobox-2.0.1}/tests/test_layout.py +0 -0
  84. {geobox-2.0.0 → geobox-2.0.1}/tests/test_log.py +0 -0
  85. {geobox-2.0.0 → geobox-2.0.1}/tests/test_map.py +0 -0
  86. {geobox-2.0.0 → geobox-2.0.1}/tests/test_model3d.py +0 -0
  87. {geobox-2.0.0 → geobox-2.0.1}/tests/test_mosaic.py +0 -0
  88. {geobox-2.0.0 → geobox-2.0.1}/tests/test_plan.py +0 -0
  89. {geobox-2.0.0 → geobox-2.0.1}/tests/test_raster.py +0 -0
  90. {geobox-2.0.0 → geobox-2.0.1}/tests/test_route.py +0 -0
  91. {geobox-2.0.0 → geobox-2.0.1}/tests/test_scene.py +0 -0
  92. {geobox-2.0.0 → geobox-2.0.1}/tests/test_settings.py +0 -0
  93. {geobox-2.0.0 → geobox-2.0.1}/tests/test_task.py +0 -0
  94. {geobox-2.0.0 → geobox-2.0.1}/tests/test_tile3d.py +0 -0
  95. {geobox-2.0.0 → geobox-2.0.1}/tests/test_tileset.py +0 -0
  96. {geobox-2.0.0 → geobox-2.0.1}/tests/test_usage.py +0 -0
  97. {geobox-2.0.0 → geobox-2.0.1}/tests/test_user.py +0 -0
  98. {geobox-2.0.0 → geobox-2.0.1}/tests/test_vectorlayer.py +0 -0
  99. {geobox-2.0.0 → geobox-2.0.1}/tests/test_version.py +0 -0
  100. {geobox-2.0.0 → geobox-2.0.1}/tests/test_view.py +0 -0
  101. {geobox-2.0.0 → geobox-2.0.1}/tests/test_workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geobox
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: SDK for Geobox's APIs
5
5
  Author-email: Hamid Heydari <heydari.h62@gmail.com>
6
6
  License: MIT
@@ -762,7 +762,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
762
762
  return await VectorLayerView.get_views_by_ids(self, ids, user_id, include_settings)
763
763
 
764
764
 
765
- async def get_view(self, uuid: str) -> 'VectorLayerView':
765
+ async def get_view(self, uuid: str, user_id: int = None) -> 'VectorLayerView':
766
766
  """
767
767
  [async] Get a specific vector layer view by its UUID.
768
768
 
@@ -778,7 +778,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
778
778
  >>> async with AsyncGeoboxClient() as client:
779
779
  >>> view = await client.get_view(uuid="12345678-1234-5678-1234-567812345678")
780
780
  """
781
- return await VectorLayerView.get_view(self, uuid)
781
+ return await VectorLayerView.get_view(self, uuid, user_id)
782
782
 
783
783
 
784
784
  async def get_view_by_name(self, name: str, user_id: int = None) -> Union['VectorLayerView', None]:
@@ -349,8 +349,6 @@ class Query(AsyncBase):
349
349
  >>> query.add_param(name='param_name', value='param_value', type=QueryParamType.LAYER)
350
350
  >>> await query.save()
351
351
  """
352
- self._check_access()
353
-
354
352
  self.params.append({
355
353
  'name': name,
356
354
  'value': value,
@@ -384,8 +382,6 @@ class Query(AsyncBase):
384
382
  >>> query.remove_param(name='param_name')
385
383
  >>> await quary.save()
386
384
  """
387
- self._check_access()
388
-
389
385
  for i, param in enumerate(self.params):
390
386
  if param.get('name') == name:
391
387
  self.params.pop(i)
@@ -430,8 +426,6 @@ class Query(AsyncBase):
430
426
  >>> query = await client.get_query(uuid="12345678-1234-5678-1234-567812345678")
431
427
  >>> await query.execute(f='json')
432
428
  """
433
- self._check_access()
434
-
435
429
  if not self.sql:
436
430
  raise ValueError('"sql" parameter is required for this action!')
437
431
  if not self.params:
@@ -632,7 +626,6 @@ class Query(AsyncBase):
632
626
  >>> query = await Query.get_query(client, uuid="12345678-1234-5678-1234-567812345678")
633
627
  >>> query.thumbnail
634
628
  """
635
- self._check_access()
636
629
  return super().thumbnail()
637
630
 
638
631
 
@@ -657,8 +650,6 @@ class Query(AsyncBase):
657
650
  >>> query = await Query.get_query(client, uuid="12345678-1234-5678-1234-567812345678")
658
651
  >>> await query.save_as_layer(layer_name='test')
659
652
  """
660
- self._check_access()
661
-
662
653
  params = [{
663
654
  "name": item.get('name'),
664
655
  "type": item.get('type'),
@@ -168,7 +168,7 @@ class Usage(AsyncBase):
168
168
  user_id (int, optional): the id of the user. leave blank to get the current user report.
169
169
 
170
170
  Returns:
171
- Dict: the usage summery of the users
171
+ Dict: the usage summary of the users
172
172
 
173
173
  Returns:
174
174
  >>> from geobox.aio import AsyncGeoboxClient
@@ -92,7 +92,7 @@ class Workflow(AsyncBase):
92
92
  description (str): The description of the workflow.
93
93
  settings (Dict): The settings of the workflow.
94
94
  thumbnail (str): The thumbnail of the workflow.
95
- user_id (int): Specific user. privileges workflow.
95
+ user_id (int): Specific user. privileges required.
96
96
 
97
97
  Returns:
98
98
  Workflow: The newly created workflow instance.
@@ -134,7 +134,6 @@ class _RequestSession(requests.Session):
134
134
  kwargs['headers'] = request_headers
135
135
 
136
136
  try:
137
- print(kwargs['headers'])
138
137
  response = super().request(method, url, **kwargs)
139
138
  finally:
140
139
  if original_content_type:
@@ -327,7 +326,6 @@ class GeoboxClient:
327
326
 
328
327
  try:
329
328
  if files:
330
- print(files)
331
329
  response = self.session.request(method, url, data=payload, files=files)
332
330
  elif is_json:
333
331
  response = self.session.request(method, url, json=payload)
@@ -746,7 +744,7 @@ class GeoboxClient:
746
744
  return VectorLayerView.get_views_by_ids(self, ids, user_id, include_settings)
747
745
 
748
746
 
749
- def get_view(self, uuid: str) -> 'VectorLayerView':
747
+ def get_view(self, uuid: str, user_id: int = None) -> 'VectorLayerView':
750
748
  """
751
749
  Get a specific vector layer view by its UUID.
752
750
 
@@ -762,7 +760,7 @@ class GeoboxClient:
762
760
  >>> client = GeoboxClient()
763
761
  >>> view = client.get_view(uuid="12345678-1234-5678-1234-567812345678")
764
762
  """
765
- return VectorLayerView.get_view(self, uuid)
763
+ return VectorLayerView.get_view(self, uuid, user_id)
766
764
 
767
765
 
768
766
  def get_view_by_name(self, name: str, user_id: int = None) -> Union['VectorLayerView', None]:
@@ -348,8 +348,6 @@ class Query(Base):
348
348
  >>> query.add_param(name='param_name', value='param_value', type=QueryParamType.LAYER)
349
349
  >>> query.save()
350
350
  """
351
- self._check_access()
352
-
353
351
  self.params.append({
354
352
  'name': name,
355
353
  'value': value,
@@ -383,8 +381,6 @@ class Query(Base):
383
381
  >>> query.remove_param(name='param_name')
384
382
  >>> query.save()
385
383
  """
386
- self._check_access()
387
-
388
384
  for i, param in enumerate(self.params):
389
385
  if param.get('name') == name:
390
386
  self.params.pop(i)
@@ -428,9 +424,7 @@ class Query(Base):
428
424
  or
429
425
  >>> query = client.get_query(uuid="12345678-1234-5678-1234-567812345678")
430
426
  >>> query.execute(f='json')
431
- """
432
- self._check_access()
433
-
427
+ """
434
428
  if not self.sql:
435
429
  raise ValueError('"sql" parameter is required for this action!')
436
430
  if not self.params:
@@ -631,7 +625,6 @@ class Query(Base):
631
625
  >>> query = Query.get_query(client, uuid="12345678-1234-5678-1234-567812345678")
632
626
  >>> query.thumbnail
633
627
  """
634
- self._check_access()
635
628
  return super().thumbnail()
636
629
 
637
630
 
@@ -656,8 +649,6 @@ class Query(Base):
656
649
  >>> query = Query.get_query(client, uuid="12345678-1234-5678-1234-567812345678")
657
650
  >>> query.save_as_layer(layer_name='test')
658
651
  """
659
- self._check_access()
660
-
661
652
  params = [{
662
653
  "name": item.get('name'),
663
654
  "type": item.get('type'),
@@ -80,8 +80,8 @@ class VectorLayerView(VectorLayer):
80
80
  search_fields(str): Comma separated list of fields for searching.
81
81
  order_by(str): comma separated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D. NOTE: "A" denotes ascending order and "D" denotes descending order.
82
82
  return_count(bool): Whether to return the count of the layer views. default is False.
83
- skip(int): The number of layer views to skip. minimum is 0.
84
- limit(int): The maximum number of layer views to return. minimum is 1. default is 10.
83
+ skip(int): The number of views to skip. minimum is 0.
84
+ limit(int): The maximum number of views to return. minimum is 1. default is 10.
85
85
  user_id(int): Specific user. privileges required.
86
86
  shared(bool): Whether to return shared views. default is False.
87
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geobox
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: SDK for Geobox's APIs
5
5
  Author-email: Hamid Heydari <heydari.h62@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "geobox"
7
- version = "2.0.0"
7
+ version = "2.0.1"
8
8
  description = "SDK for Geobox's APIs"
9
9
  authors = [
10
10
  {name = "Hamid Heydari", email = "heydari.h62@gmail.com"}
@@ -187,12 +187,6 @@ def test_add_param(api, mock_query_data):
187
187
  assert new_param['default_value'] == "default"
188
188
  assert new_param['Domain'] == {'key': 'value'}
189
189
 
190
- # add param to system query
191
- query = Query(api, mock_query_data['uuid'], mock_query_data)
192
- query._system_query = True
193
-
194
- with pytest.raises(PermissionError):
195
- query.add_param("test", "value", QueryParamType.TEXT)
196
190
 
197
191
 
198
192
  def test_remove_param(api, mock_query_data):
@@ -210,12 +204,6 @@ def test_remove_param(api, mock_query_data):
210
204
  with pytest.raises(ValueError, match="Parameter with name 'nonexistent' not found"):
211
205
  query.remove_param("nonexistent")
212
206
 
213
- # remove system query param
214
- query = Query(api, mock_query_data['uuid'], mock_query_data)
215
- query._system_query = True
216
-
217
- with pytest.raises(PermissionError):
218
- query.remove_param("test")
219
207
 
220
208
 
221
209
  def test_execute(api, mock_query_data):
@@ -256,15 +244,6 @@ def test_execute_no_params(api, mock_query_data):
256
244
  query.execute()
257
245
 
258
246
 
259
- def test_execute_system_query(api, mock_query_data):
260
- """Test execute raises exception for system queries."""
261
- query = Query(api, mock_query_data['uuid'], mock_query_data)
262
- query._system_query = True
263
-
264
- with pytest.raises(PermissionError):
265
- query.execute()
266
-
267
-
268
247
  def test_update(api, mock_query_data):
269
248
  """Test update_query method."""
270
249
  query = Query(api, mock_query_data['uuid'], mock_query_data)
@@ -434,13 +413,6 @@ def test_thumbnail(api, mock_query_data):
434
413
 
435
414
  assert thumbnail_url == f'{api.base_url}{query.endpoint}thumbnail.png'
436
415
 
437
- # get system query thumbnail
438
- query = Query(api, mock_query_data['uuid'], mock_query_data)
439
- query._system_query = True
440
-
441
- with pytest.raises(PermissionError):
442
- query.thumbnail
443
-
444
416
 
445
417
  def test_save_as_layer(api, mock_query_data, mock_success_task_data):
446
418
  """Test save_as_layer method."""
@@ -453,13 +425,6 @@ def test_save_as_layer(api, mock_query_data, mock_success_task_data):
453
425
  api.post.assert_called_once_with(f'{query.BASE_ENDPOINT}saveAsLayer/', {'sql': 'SELECT layer.*, ST_Centroid(geom) as goem\nFROM layer', 'params': [{'name': 'layer', 'type': 'Layer', 'value': None}, {'name': 'layer', 'type': 'Layer', 'value': '297fa7ca-877a-400c-8003-d65de9e791c2'}], 'layer_name': 'new_layer', 'layer_type': 'Point'})
454
426
  assert isinstance(task, Task)
455
427
 
456
- # save system query as layer
457
- query = Query(api, mock_query_data['uuid'], mock_query_data)
458
- query._system_query = True
459
-
460
- with pytest.raises(PermissionError):
461
- query.save_as_layer("test_layer", QueryGeometryType.POINT)
462
-
463
428
 
464
429
  def test_to_async(api, async_api, mock_query_data):
465
430
  query = Query(api, mock_query_data['uuid'], mock_query_data)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes