pygeobox 1.0.1__py3-none-any.whl → 1.0.2__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.
- pygeobox/__init__.py +63 -63
- pygeobox/api.py +2517 -2517
- pygeobox/apikey.py +232 -232
- pygeobox/attachment.py +297 -297
- pygeobox/base.py +364 -364
- pygeobox/basemap.py +162 -162
- pygeobox/dashboard.py +316 -316
- pygeobox/enums.py +354 -354
- pygeobox/exception.py +47 -47
- pygeobox/field.py +309 -309
- pygeobox/map.py +858 -858
- pygeobox/model3d.py +334 -334
- pygeobox/mosaic.py +647 -647
- pygeobox/plan.py +260 -260
- pygeobox/query.py +668 -668
- pygeobox/raster.py +756 -756
- pygeobox/route.py +63 -63
- pygeobox/scene.py +317 -317
- pygeobox/settings.py +165 -165
- pygeobox/task.py +354 -354
- pygeobox/tile3d.py +294 -294
- pygeobox/tileset.py +585 -585
- pygeobox/user.py +423 -423
- pygeobox/utils.py +43 -43
- pygeobox/vectorlayer.py +1149 -1149
- pygeobox/version.py +248 -248
- pygeobox/view.py +859 -859
- pygeobox/workflow.py +315 -315
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/METADATA +18 -24
- pygeobox-1.0.2.dist-info/RECORD +37 -0
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/licenses/LICENSE +21 -21
- pygeobox-1.0.1.dist-info/RECORD +0 -37
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/WHEEL +0 -0
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/top_level.txt +0 -0
pygeobox/utils.py
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
2
|
-
|
3
|
-
|
4
|
-
def clean_data(data: dict) -> dict:
|
5
|
-
"""
|
6
|
-
Cleans the input data by removing keys with None values.
|
7
|
-
|
8
|
-
Args:
|
9
|
-
data (dict): The input data.
|
10
|
-
|
11
|
-
Returns:
|
12
|
-
dict: The cleaned data.
|
13
|
-
"""
|
14
|
-
return {k: v for k, v in data.items() if v is not None}
|
15
|
-
|
16
|
-
def join_url_params(base_url: str, params: dict) -> str:
|
17
|
-
"""
|
18
|
-
Join URL with parameters while preserving existing query parameters.
|
19
|
-
|
20
|
-
Args:
|
21
|
-
base_url (str): Base URL that may contain existing parameters
|
22
|
-
params (dict): New parameters to add
|
23
|
-
|
24
|
-
Returns:
|
25
|
-
str: URL with all parameters properly joined
|
26
|
-
"""
|
27
|
-
# Parse the URL
|
28
|
-
parsed = urlparse(base_url)
|
29
|
-
|
30
|
-
# Get existing parameters
|
31
|
-
existing_params = parse_qs(parsed.query)
|
32
|
-
|
33
|
-
# Update with new parameters
|
34
|
-
existing_params.update(params)
|
35
|
-
|
36
|
-
# Reconstruct the URL
|
37
|
-
return urlunparse((
|
38
|
-
parsed.scheme,
|
39
|
-
parsed.netloc,
|
40
|
-
parsed.path,
|
41
|
-
parsed.params,
|
42
|
-
urlencode(existing_params, doseq=True),
|
43
|
-
parsed.fragment
|
1
|
+
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
2
|
+
|
3
|
+
|
4
|
+
def clean_data(data: dict) -> dict:
|
5
|
+
"""
|
6
|
+
Cleans the input data by removing keys with None values.
|
7
|
+
|
8
|
+
Args:
|
9
|
+
data (dict): The input data.
|
10
|
+
|
11
|
+
Returns:
|
12
|
+
dict: The cleaned data.
|
13
|
+
"""
|
14
|
+
return {k: v for k, v in data.items() if v is not None}
|
15
|
+
|
16
|
+
def join_url_params(base_url: str, params: dict) -> str:
|
17
|
+
"""
|
18
|
+
Join URL with parameters while preserving existing query parameters.
|
19
|
+
|
20
|
+
Args:
|
21
|
+
base_url (str): Base URL that may contain existing parameters
|
22
|
+
params (dict): New parameters to add
|
23
|
+
|
24
|
+
Returns:
|
25
|
+
str: URL with all parameters properly joined
|
26
|
+
"""
|
27
|
+
# Parse the URL
|
28
|
+
parsed = urlparse(base_url)
|
29
|
+
|
30
|
+
# Get existing parameters
|
31
|
+
existing_params = parse_qs(parsed.query)
|
32
|
+
|
33
|
+
# Update with new parameters
|
34
|
+
existing_params.update(params)
|
35
|
+
|
36
|
+
# Reconstruct the URL
|
37
|
+
return urlunparse((
|
38
|
+
parsed.scheme,
|
39
|
+
parsed.netloc,
|
40
|
+
parsed.path,
|
41
|
+
parsed.params,
|
42
|
+
urlencode(existing_params, doseq=True),
|
43
|
+
parsed.fragment
|
44
44
|
))
|