stac-fastapi.types 2.5.1__tar.gz → 2.5.3__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.
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/PKG-INFO +1 -1
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/rfc3339.py +11 -6
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/search.py +1 -1
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/version.py +1 -1
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/PKG-INFO +1 -1
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/tests/test_rfc3339.py +7 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/README.md +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/setup.cfg +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/setup.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/__init__.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/config.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/conformance.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/core.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/errors.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/extension.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/links.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/requests.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi/types/stac.py +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/SOURCES.txt +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/dependency_links.txt +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/not-zip-safe +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/requires.txt +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/top_level.txt +0 -0
- {stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/tests/test_limit.py +0 -0
|
@@ -45,9 +45,7 @@ def rfc3339_str_to_datetime(s: str) -> datetime:
|
|
|
45
45
|
return iso8601.parse_date(s)
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def str_to_interval(
|
|
49
|
-
interval: str,
|
|
50
|
-
) -> Optional[DateTimeType]:
|
|
48
|
+
def str_to_interval(interval: Optional[str]) -> Optional[DateTimeType]:
|
|
51
49
|
"""Extract a tuple of datetimes from an interval string.
|
|
52
50
|
|
|
53
51
|
Interval strings are defined by
|
|
@@ -56,12 +54,19 @@ def str_to_interval(
|
|
|
56
54
|
or end (but not both) to be open-ended with '..' or ''.
|
|
57
55
|
|
|
58
56
|
Args:
|
|
59
|
-
interval (str)
|
|
60
|
-
|
|
57
|
+
interval (str or None): The interval string to convert to a tuple of
|
|
58
|
+
datetime.datetime objects, or None if no datetime is specified.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Optional[DateTimeType]: A tuple of datetime.datetime objects or None if
|
|
62
|
+
input is None.
|
|
61
63
|
|
|
62
64
|
Raises:
|
|
63
|
-
ValueError: If the string is not a valid interval string.
|
|
65
|
+
ValueError: If the string is not a valid interval string and not None.
|
|
64
66
|
"""
|
|
67
|
+
if interval is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
65
70
|
if not interval:
|
|
66
71
|
raise ValueError("Empty interval string is invalid.")
|
|
67
72
|
|
|
@@ -108,7 +108,7 @@ class BaseSearchGetRequest(APIRequest):
|
|
|
108
108
|
collections: Optional[str] = attr.ib(default=None, converter=str2list)
|
|
109
109
|
ids: Optional[str] = attr.ib(default=None, converter=str2list)
|
|
110
110
|
bbox: Optional[BBox] = attr.ib(default=None, converter=str2bbox)
|
|
111
|
-
intersects: Optional[str] = attr.ib(default=None
|
|
111
|
+
intersects: Optional[str] = attr.ib(default=None)
|
|
112
112
|
datetime: Optional[DateTimeType] = attr.ib(default=None, converter=str_to_interval)
|
|
113
113
|
limit: Optional[int] = attr.ib(default=10)
|
|
114
114
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Library version."""
|
|
2
|
-
__version__ = "2.5.
|
|
2
|
+
__version__ = "2.5.3"
|
|
@@ -103,3 +103,10 @@ def test_now_functions() -> None:
|
|
|
103
103
|
assert now1.tzinfo == timezone.utc
|
|
104
104
|
|
|
105
105
|
rfc3339_str_to_datetime(now_to_rfc3339_str())
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_str_to_interval_with_none():
|
|
109
|
+
"""Test that str_to_interval returns None when provided with None."""
|
|
110
|
+
assert (
|
|
111
|
+
str_to_interval(None) is None
|
|
112
|
+
), "str_to_interval should return None when input is None"
|
|
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
|
{stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/requires.txt
RENAMED
|
File without changes
|
{stac_fastapi_types-2.5.1 → stac_fastapi_types-2.5.3}/stac_fastapi.types.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|