nexus-extensibility 2.0.0b46__py3-none-any.whl → 2.0.0b48__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.
- nexus_extensibility/_extensibility_data_source.py +24 -8
- {nexus_extensibility-2.0.0b46.dist-info → nexus_extensibility-2.0.0b48.dist-info}/METADATA +1 -1
- {nexus_extensibility-2.0.0b46.dist-info → nexus_extensibility-2.0.0b48.dist-info}/RECORD +5 -5
- {nexus_extensibility-2.0.0b46.dist-info → nexus_extensibility-2.0.0b48.dist-info}/WHEEL +0 -0
- {nexus_extensibility-2.0.0b46.dist-info → nexus_extensibility-2.0.0b48.dist-info}/top_level.txt +0 -0
@@ -2,8 +2,8 @@ import enum
|
|
2
2
|
from abc import ABC, abstractmethod
|
3
3
|
from dataclasses import dataclass
|
4
4
|
from datetime import datetime
|
5
|
-
from typing import (Any, Awaitable, Callable,
|
6
|
-
|
5
|
+
from typing import (Any, Awaitable, Callable, Generic, Optional, Protocol,
|
6
|
+
TypeVar)
|
7
7
|
from urllib.parse import ParseResult
|
8
8
|
|
9
9
|
from ._data_model import CatalogItem, CatalogRegistration, ResourceCatalog
|
@@ -57,9 +57,25 @@ class DataSourceContext(Generic[T]):
|
|
57
57
|
source_configuration: T
|
58
58
|
"""The source configuration."""
|
59
59
|
|
60
|
-
request_configuration: Optional[
|
60
|
+
request_configuration: Optional[dict[str, Any]]
|
61
61
|
"""The request configuration."""
|
62
62
|
|
63
|
+
@dataclass(frozen=True)
|
64
|
+
class CatalogTimeRange:
|
65
|
+
"""
|
66
|
+
A data source time range.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
begin: The date/time of the first data in the catalog.
|
70
|
+
end: The date/time of the last data in the catalog.
|
71
|
+
"""
|
72
|
+
|
73
|
+
begin: datetime
|
74
|
+
"""The date/time of the first data in the catalog."""
|
75
|
+
|
76
|
+
end: datetime
|
77
|
+
"""The date/time of the last data in the catalog."""
|
78
|
+
|
63
79
|
@dataclass(frozen=True)
|
64
80
|
class ReadRequest:
|
65
81
|
"""
|
@@ -120,7 +136,7 @@ class IDataSource(Generic[T], ABC):
|
|
120
136
|
pass
|
121
137
|
|
122
138
|
@abstractmethod
|
123
|
-
def get_catalog_registrations(self, path: str) -> Awaitable[
|
139
|
+
def get_catalog_registrations(self, path: str) -> Awaitable[list[CatalogRegistration]]:
|
124
140
|
"""
|
125
141
|
Gets the catalog registrations that are located under path.
|
126
142
|
|
@@ -140,7 +156,7 @@ class IDataSource(Generic[T], ABC):
|
|
140
156
|
pass
|
141
157
|
|
142
158
|
@abstractmethod
|
143
|
-
def get_time_range(self, catalog_id: str) -> Awaitable[
|
159
|
+
def get_time_range(self, catalog_id: str) -> Awaitable[CatalogTimeRange]:
|
144
160
|
"""
|
145
161
|
Gets the time range of the ResourceCatalog.
|
146
162
|
|
@@ -214,15 +230,15 @@ class SimpleDataSource(Generic[T], IDataSource[T], ABC):
|
|
214
230
|
self.Logger = logger
|
215
231
|
|
216
232
|
@abstractmethod
|
217
|
-
def get_catalog_registrations(self, path: str) -> Awaitable[
|
233
|
+
def get_catalog_registrations(self, path: str) -> Awaitable[list[CatalogRegistration]]:
|
218
234
|
pass
|
219
235
|
|
220
236
|
@abstractmethod
|
221
237
|
def enrich_catalog(self, catalog: ResourceCatalog) -> Awaitable[ResourceCatalog]:
|
222
238
|
pass
|
223
239
|
|
224
|
-
async def get_time_range(self, catalog_id: str) ->
|
225
|
-
return (datetime.min, datetime.max)
|
240
|
+
async def get_time_range(self, catalog_id: str) -> CatalogTimeRange:
|
241
|
+
return CatalogTimeRange(datetime.min, datetime.max)
|
226
242
|
|
227
243
|
async def get_availability(self, catalog_id: str, begin: datetime, end: datetime) -> float:
|
228
244
|
return float("NaN")
|
@@ -2,9 +2,9 @@ nexus_extensibility/__init__.py,sha256=temuSqvUeZusU_0j-QoRalMIDfCHm9JP8W6jEO280
|
|
2
2
|
nexus_extensibility/_data_model.py,sha256=HBuH2ftXAq_a5pJWc5UtqbEEcQIVAolz3xLUYgAHyk0,11964
|
3
3
|
nexus_extensibility/_data_model_extensions.py,sha256=iLSOVDKvVoorj2h0x_XHGhbKwd_NHtrURgS7aUVe8MI,670
|
4
4
|
nexus_extensibility/_data_model_utilities.py,sha256=cb_uJD4CeYz1m7NEttQ7kR3nrcMjovJQCrSUchnglQE,377
|
5
|
-
nexus_extensibility/_extensibility_data_source.py,sha256=
|
5
|
+
nexus_extensibility/_extensibility_data_source.py,sha256=Gz9Mi8EWeBX7Enaq_3LYkKeXOBeMFhw-OEhGpxOpHPU,7893
|
6
6
|
nexus_extensibility/_extensibility_utilities.py,sha256=hQFcY2joHt1goJSCvMfEW5cprN1I-B1-SihqYme8R1A,786
|
7
|
-
nexus_extensibility-2.0.
|
8
|
-
nexus_extensibility-2.0.
|
9
|
-
nexus_extensibility-2.0.
|
10
|
-
nexus_extensibility-2.0.
|
7
|
+
nexus_extensibility-2.0.0b48.dist-info/METADATA,sha256=oTkOKtHOHlfjBvM9Z61OEaVef5UDeJGrfQIVSfVy3bU,775
|
8
|
+
nexus_extensibility-2.0.0b48.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
9
|
+
nexus_extensibility-2.0.0b48.dist-info/top_level.txt,sha256=GTaw9wgS6EKrgO6FhJ3YZuMrkgoK7kP-hW9uybPDbyg,20
|
10
|
+
nexus_extensibility-2.0.0b48.dist-info/RECORD,,
|
File without changes
|
{nexus_extensibility-2.0.0b46.dist-info → nexus_extensibility-2.0.0b48.dist-info}/top_level.txt
RENAMED
File without changes
|