geobox 1.1.0__py3-none-any.whl → 1.1.1__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.
geobox/api.py CHANGED
@@ -597,23 +597,23 @@ class GeoboxClient:
597
597
  return File.get_file(self, uuid=uuid)
598
598
 
599
599
 
600
- def get_file_by_name(self, name: str, user_id: int = None) -> Union['File', None]:
600
+ def get_files_by_name(self, name: str, user_id: int = None) -> List['File']:
601
601
  """
602
- Get a file by name
602
+ Get files by name
603
603
 
604
604
  Args:
605
605
  name (str): the name of the file to get
606
606
  user_id (int, optional): specific user. privileges required.
607
607
 
608
608
  Returns:
609
- File | None: returns the file if a file matches the given name, else None
609
+ List[File]: returns files that matches the given name
610
610
 
611
611
  Example:
612
612
  >>> from geobox import GeoboxClient
613
613
  >>> client = GeoboxClient()
614
- >>> file = client.get_file_by_name(name='test')
614
+ >>> files = client.get_files_by_name(name='test')
615
615
  """
616
- return File.get_file_by_name(self, name, user_id)
616
+ return File.get_files_by_name(self, name, user_id)
617
617
 
618
618
 
619
619
  def upload_file(self, path: str, user_id: int = None, scan_archive: bool = True) -> 'File':
geobox/enums.py CHANGED
@@ -30,7 +30,7 @@ class FileType(Enum):
30
30
  GPX = '.gpx'
31
31
  GPKG = '.gpkg'
32
32
  GeoJSON = '.geojson'
33
- GeoTIFF = '.tif'
33
+ GeoTIFF = '.tiff'
34
34
 
35
35
  # Image Formats
36
36
  JPG = '.jpg'
geobox/file.py CHANGED
@@ -188,9 +188,9 @@ class File(Base):
188
188
 
189
189
 
190
190
  @classmethod
191
- def get_file_by_name(cls, api: 'GeoboxClient', name: str, user_id: int = None) -> Union['File', None]:
191
+ def get_files_by_name(cls, api: 'GeoboxClient', name: str, user_id: int = None) -> List['File']:
192
192
  """
193
- Get a file by name
193
+ Get files by name
194
194
 
195
195
  Args:
196
196
  api (GeoboxClient): The GeoboxClient instance for making requests.
@@ -198,21 +198,17 @@ class File(Base):
198
198
  user_id (int, optional): specific user. privileges required.
199
199
 
200
200
  Returns:
201
- File | None: returns the file if a file matches the given name, else None
201
+ List[File]: returns files that matches the given name
202
202
 
203
203
  Example:
204
204
  >>> from geobox import GeoboxClient
205
205
  >>> from geobox.file import File
206
206
  >>> client = GeoboxClient()
207
- >>> file = File.get_file_by_name(client, name='test')
207
+ >>> files = File.get_file_by_name(client, name='test')
208
208
  or
209
- >>> file = client.get_file_by_name(name='test')
209
+ >>> files = client.get_file_by_name(name='test')
210
210
  """
211
- files = cls.get_files(api, q=f"name = '{name}'", user_id=user_id)
212
- if files and files[0].name == name:
213
- return files[0]
214
- else:
215
- return None
211
+ return cls.get_files(api, q=f"name = '{name}'", user_id=user_id)
216
212
 
217
213
 
218
214
  def _get_save_path(self, save_path: str = None) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geobox
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: SDK for Geobox's APIs
5
5
  Author-email: Hamid Heydari <heydari.h62@gmail.com>
6
6
  License: MIT
@@ -1,15 +1,15 @@
1
1
  geobox/__init__.py,sha256=iRkJAFIjMXiAaLTVXvZcW5HM7ttyipGdxFZ15NCM8qU,1895
2
- geobox/api.py,sha256=sLnq3B15UCgit_3PMMxKDnTI7hG7QykZK0uliu6Gu3A,100562
2
+ geobox/api.py,sha256=Sq9iKYltgdR96cA4w5_5jMraNqAUpgSzMriO9PbZFNA,100538
3
3
  geobox/apikey.py,sha256=FBio1PtGovAUaTE0HW9IJ55UuFdR_1ICk_FQhHu5dAE,7427
4
4
  geobox/attachment.py,sha256=XbGwfWWuFAMimj4tsjKBvlSLP-rhpNACCtxgRmUvcdY,11631
5
5
  geobox/base.py,sha256=p0UVZo9CINw0mW9o0nNR_VNCk7V1r-FrLQ_NH39WARE,12299
6
6
  geobox/basemap.py,sha256=fDWwkMf-F2NTE1tVLijoxQku55825b6gj8nk69TMOII,4386
7
7
  geobox/dashboard.py,sha256=MYyT3YJEGPCbTXHcYoZmn14rFOaut1J3idEA8bCdFgI,11762
8
- geobox/enums.py,sha256=sNBtHlpCs7jIqIsLrdNtyThVZ2Mbsx_Cj7oxI1U5G5w,6267
8
+ geobox/enums.py,sha256=SVUmz_Z4PrPSauutULb3lzrEwNuGJ2qa_DRgpz7n5qo,6268
9
9
  geobox/exception.py,sha256=jvpnv0M2Ck1FpxHTL_aKYWxGvLnCQ3d9vOrMIktjw1U,1507
10
10
  geobox/feature.py,sha256=3Kbc1LjIkBt1YqRAry84BrR7qxx9BexvBB3YQ8D9mGk,18504
11
11
  geobox/field.py,sha256=2VxjeYgRwnDxHYpAsK0ASOCz8V0JmfTA3GqHDv3rfgQ,10526
12
- geobox/file.py,sha256=4nlvQ6FBqOJ4WpsZYs5QnAq8hZfcD_f9KOaUFluhoxs,18610
12
+ geobox/file.py,sha256=YlBrX8apx-4Z0QutZq9fdoVqdfqqQop0UdHdzr6daII,18474
13
13
  geobox/log.py,sha256=ZTmVErhyAszf7M5YFxT5mqXNNDGPnRwXPeGLDS1G6PE,3582
14
14
  geobox/map.py,sha256=98P1gbB5U_eu71Hu6EQ0kL_ponbPAnoOCitjEa35q4I,31307
15
15
  geobox/model3d.py,sha256=qRYCx-q9LpGhdu5oz3av0uUoiDimuk4BvXXwMW5bo9Q,12061
@@ -30,8 +30,8 @@ geobox/vectorlayer.py,sha256=xnYsJei-bpKgM_EJlRbZ-bAIHdmvfU-VZ2t-NEEJCfc,49420
30
30
  geobox/version.py,sha256=0GLPhxCeEb2bAkdpPJWtXPXc1KP6kQ_TOMwLAL0ldo0,9374
31
31
  geobox/view.py,sha256=fRYlzNu4eGl6Zx9gPom47BkVE8DfWLj0bNlW2-u4TOU,37390
32
32
  geobox/workflow.py,sha256=6hKnSw4G0_ZlgmUb0g3fxT-UVsFbiYpF2FbEO5fpQv0,11606
33
- geobox-1.1.0.dist-info/licenses/LICENSE,sha256=AvFB7W94sJYKLDhBxLRshL3upexCOG8HQY_1JibB96w,1063
34
- geobox-1.1.0.dist-info/METADATA,sha256=7tl1V2oQpCqPITA_wXvZ2_zr8vCtu5URSxQ81u5Fe-E,2556
35
- geobox-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- geobox-1.1.0.dist-info/top_level.txt,sha256=ppXH8Bu2mlB-pLQ6lsoWEm2Gr6wZx1uzkhetsYA5ins,7
37
- geobox-1.1.0.dist-info/RECORD,,
33
+ geobox-1.1.1.dist-info/licenses/LICENSE,sha256=AvFB7W94sJYKLDhBxLRshL3upexCOG8HQY_1JibB96w,1063
34
+ geobox-1.1.1.dist-info/METADATA,sha256=H10IZAEE-owFW1GSsxbwh-f80oe4HSp9NW2l4Qi2UYE,2556
35
+ geobox-1.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ geobox-1.1.1.dist-info/top_level.txt,sha256=ppXH8Bu2mlB-pLQ6lsoWEm2Gr6wZx1uzkhetsYA5ins,7
37
+ geobox-1.1.1.dist-info/RECORD,,
File without changes