You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/rustac/__init__.py
+32-32Lines changed: 32 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,74 +1,74 @@
1
1
from __future__ importannotations
2
2
3
3
from .rustacimport*
4
-
fromtypingimportTypedDict
4
+
fromtypingimportTypedDict, Required, Any, Literal
5
5
6
6
7
-
classCatalog(TypedDict):
7
+
classCatalog(TypedDict, total=False):
8
8
"""A STAC Catalog object represents a logical group of other Catalog, Collection, and Item objects."""
9
9
10
-
type: str
10
+
type: Required[str]
11
11
"""Set to Catalog if this Catalog only implements the Catalog spec."""
12
12
13
-
stac_version: str
13
+
stac_version: Required[str]
14
14
"""The STAC version the Catalog implements."""
15
15
16
16
stac_extensions: list[str] |None
17
17
"""A list of extension identifiers the Catalog implements."""
18
18
19
-
id: str
19
+
id: Required[str]
20
20
"""Identifier for the Catalog."""
21
21
22
22
title: str|None
23
23
"""A short descriptive one-line title for the Catalog."""
24
24
25
-
description: str
25
+
description: Required[str]
26
26
"""Detailed multi-line description to fully explain the Catalog.
27
27
28
28
CommonMark 0.29 syntax MAY be used for rich text representation."""
29
29
30
-
links: list[Link]
30
+
links: Required[list[Link]]
31
31
"""A list of references to other documents."""
32
32
33
-
classCollection(TypedDict):
33
+
classCollection(TypedDict, total=False):
34
34
"""The STAC Collection Specification defines a set of common fields to describe a group of Items that share properties and metadata."""
35
35
36
-
type: str
36
+
type: Required[str]
37
37
"""Must be set to Collection to be a valid Collection."""
38
38
39
-
stac_version: str
39
+
stac_version: Required[str]
40
40
"""The STAC version the Collection implements."""
41
41
42
42
stac_extensions: list[str] |None
43
43
"""A list of extension identifiers the Collection implements."""
44
44
45
-
id: str
45
+
id: Required[str]
46
46
"""Identifier for the Collection that is unique across all collections in the root catalog."""
47
47
48
48
title: str|None
49
49
"""A short descriptive one-line title for the Collection."""
50
50
51
-
description: str
51
+
description: Required[str]
52
52
"""Detailed multi-line description to fully explain the Collection.
53
53
54
54
CommonMark 0.29 syntax MAY be used for rich text representation."""
55
55
56
56
keywords: list[str] |None
57
57
"""List of keywords describing the Collection."""
58
58
59
-
license: str
59
+
license: Required[str]
60
60
"""License(s) of the data collection as SPDX License identifier, SPDX License expression, or `other`."""
61
61
62
62
providers: list[Provider] |None
63
63
"""A list of providers, which may include all organizations capturing or processing the data or the hosting provider."""
64
64
65
-
extent: Extent
65
+
extent: Required[Extent]
66
66
"""Spatial and temporal extents."""
67
67
68
-
summaries: dict[str, Any]
68
+
summaries: dict[str, Any]|None
69
69
"""A map of property summaries, either a set of values, a range of values or a JSON Schema."""
70
70
71
-
links: list[Link]
71
+
links: Required[list[Link]]
72
72
"""A list of references to other documents."""
73
73
74
74
assets: dict[str, Asset] |None
@@ -77,10 +77,10 @@ class Collection(TypedDict):
77
77
item_assets: dict[str, ItemAsset] |None
78
78
"""A dictionary of assets that can be found in member Items."""
79
79
80
-
classProvider(TypedDict):
80
+
classProvider(TypedDict, total=False):
81
81
"""A provider is any of the organizations that captures or processes the content of the Collection and therefore influences the data offered by this Collection."""
82
82
83
-
name: str
83
+
name: Required[str]
84
84
"""The name of the organization or the individual."""
85
85
86
86
description: str|None
@@ -93,7 +93,7 @@ class Provider(TypedDict):
93
93
|Literal["producer"]
94
94
|Literal["processor"]
95
95
|Literal["host"]
96
-
]
96
+
]|None
97
97
"""Roles of the provider."""
98
98
99
99
url: str|None
@@ -120,7 +120,7 @@ class TemporalExtent(TypedDict):
120
120
bbox: list[list[str|None]]
121
121
"""Potential temporal extents covered by the Collection."""
122
122
123
-
classItemAsset(TypedDict):
123
+
classItemAsset(TypedDict, total=False):
124
124
"""An Item Asset Object defined at the Collection level is nearly the same as the Asset Object in Items, except for two differences.
125
125
126
126
The href field is not required, because Item Asset Definitions don't point to any data by themselves, but at least two other fields must be present."""
@@ -139,19 +139,19 @@ class ItemAsset(TypedDict):
139
139
roles: list[str] |None
140
140
"""The semantic roles of the asset, similar to the use of rel in links."""
141
141
142
-
classItem(TypedDict):
142
+
classItem(TypedDict, total=False):
143
143
"""An Item is a GeoJSON Feature augmented with foreign members relevant to a STAC object."""
144
144
145
-
type: str
145
+
type: Required[str]
146
146
"""Type of the GeoJSON Object. MUST be set to Feature."""
147
147
148
-
stac_version: str
148
+
stac_version: Required[str]
149
149
"""The STAC version the Item implements."""
150
150
151
151
stac_extensions: list[str] |None
152
152
"""A list of extensions the Item implements."""
153
153
154
-
id: str
154
+
id: Required[str]
155
155
"""Provider identifier. The ID should be unique within the Collection that contains the Item."""
156
156
157
157
geometry: dict[str, Any] |None
@@ -162,15 +162,15 @@ class Item(TypedDict):
162
162
163
163
Bounding Box of the asset represented by this Item, formatted according to RFC 7946, section 5."""
164
164
165
-
properties: Properties
165
+
properties: Required[Properties]
166
166
"""A dictionary of additional metadata for the Item."""
167
167
168
-
links: list[Link]
168
+
links: Required[list[Link]]
169
169
"""List of link objects to resources and related URLs.
170
170
171
171
See the best practices for details on when the use self links is strongly recommended."""
172
172
173
-
assets: dict[str, Asset]
173
+
assets: Required[dict[str, Asset]]
174
174
"""Dictionary of asset objects that can be downloaded, each with a unique key."""
175
175
176
176
collection: str|None
@@ -186,19 +186,19 @@ class Properties(TypedDict):
186
186
187
187
It is formatted according to RFC 3339, section 5.6. null is allowed, but requires start_datetime and end_datetime from common metadata to be set."""
188
188
189
-
classLink(TypedDict):
189
+
classLink(TypedDict, total=False):
190
190
"""This object describes a relationship with another entity.
191
191
192
192
Data providers are advised to be liberal with the links section, to describe
193
193
things like the Catalog an Item is in, related Items, parent or child Items
194
194
(modeled in different ways, like an 'acquisition' or derived data)."""
195
195
196
-
href: str
196
+
href: Required[str]
197
197
"""The actual link in the format of an URL.
198
198
199
199
Relative and absolute links are both allowed. Trailing slashes are significant."""
200
200
201
-
rel: str
201
+
rel: Required[str]
202
202
"""Relationship between the current document and the linked document."""
203
203
204
204
type: str|None
@@ -218,12 +218,12 @@ class Link(TypedDict):
218
218
body: Any|None
219
219
"""The HTTP body to be sent to the target resource."""
220
220
221
-
classAsset(TypedDict):
221
+
classAsset(TypedDict, total=False):
222
222
"""An Asset is an object that contains a URI to data associated with the Item that can be downloaded or streamed.
223
223
224
224
It is allowed to add additional fields."""
225
225
226
-
href: str
226
+
href: Required[str]
227
227
"""URI to the asset object. Relative and absolute URI are both allowed. Trailing slashes are significant."""
0 commit comments