Python API

Import the extension from pystac.extensions.access. Use AccessExtension.ext() to wrap STAC objects and AccessExtension.summaries() for Collection summaries.

pystac.extensions.access

Generated PySTAC extension. Edit the source schema and regenerate to update.

SCHEMA_URI = 'https://stac-extensions.github.io/access/v0.1.0/schema.json' module-attribute

AccessExtension

Bases: PropertiesExtension, ExtensionManagementMixin[Item | Collection | Catalog], Generic[T]

Typed property wrapper; use ext() to check/register the extension.

Setters preserve JSON representations, including date/time strings and nested dictionaries. None removes a property; set_null() explicitly writes JSON null. Validate the owning STAC object to enforce full schema constraints.

Source code in pystac/extensions/access.py
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
class AccessExtension(
    PropertiesExtension,
    ExtensionManagementMixin[pystac.Item | pystac.Collection | pystac.Catalog],
    Generic[T],
):
    """Typed property wrapper; use ext() to check/register the extension.

    Setters preserve JSON representations, including date/time strings and nested
    dictionaries. None removes a property; set_null() explicitly writes JSON null.
    Validate the owning STAC object to enforce full schema constraints.
    """

    def __init__(self, obj: T, target: str) -> None:
        """Bind a schema-supported STAC object's metadata for live updates."""
        self.obj: T = obj
        self._target = target
        self.additional_read_properties: list[dict[str, Any]] | None = None
        if isinstance(obj, (pystac.Item, pystac.ItemAssetDefinition)):
            self.properties = obj.properties
        else:
            self.properties = obj.extra_fields
        if isinstance(obj, pystac.Asset) and isinstance(obj.owner, pystac.Item):
            self.additional_read_properties = [obj.owner.properties]

    @classmethod
    def get_schema_uri(cls) -> str:
        """The canonical schema identifier used for extension registration."""
        return SCHEMA_URI

    @classmethod
    def has_extension(cls, obj: pystac.STACObject) -> bool:
        """Check this exact schema version; migrations are not generated."""
        return SCHEMA_URI in (obj.stac_extensions or [])

    @classmethod
    def ext(cls, obj: T, add_if_missing: bool = False) -> AccessExtension[T]:
        """Wrap a schema-supported object and optionally register its extension."""
        target = _target_for(obj)
        if isinstance(obj, (pystac.Asset, pystac.ItemAssetDefinition, pystac.Link)):
            cls.ensure_owner_has_extension(obj, add_if_missing)
        else:
            cls.ensure_has_extension(obj, add_if_missing)
        return cls(obj, target)

    def _check_field(self, key: str) -> None:
        if self._target not in FIELD_TARGETS[key]:
            raise pystac.ExtensionTypeError(f"{key} does not apply to {self._target}")

    def clear(self, name: str) -> None:
        """Remove a field using its generated Python attribute name."""
        key = FIELD_NAMES[name]
        self._check_field(key)
        self.properties.pop(key, None)

    def set_null(self, name: str) -> None:
        """Write explicit JSON null; schema validation checks whether it is permitted."""
        key = FIELD_NAMES[name]
        self._check_field(key)
        self._set_property(key, None, pop_if_none=False)

    def apply(self, **values: Any) -> None:
        """Update only supplied fields; omitted fields are preserved.

        Keys are generated Python attribute names. Unknown or inapplicable fields
        are rejected before mutation. Validate the STAC object to check values afterwards.
        """
        for name in values:
            if name not in FIELD_NAMES:
                raise TypeError(f"Unknown extension field: {name}")
            self._check_field(FIELD_NAMES[name])
        for name, value in values.items():
            setattr(self, name, value)

    @property
    def availability(self) -> Literal["online", "nearline", "offline"] | None:
        "access:availability"
        self._check_field("access:availability")
        if "access:availability" in self.properties:
            return cast(
                "Literal['online', 'nearline', 'offline'] | None",
                self.properties["access:availability"],
            )
        return cast(
            "Literal['online', 'nearline', 'offline'] | None",
            self._get_property("access:availability", object),
        )

    @availability.setter
    def availability(self, value: Literal["online", "nearline", "offline"] | None) -> None:
        self._check_field("access:availability")
        self._set_property("access:availability", _encode(value))

    @property
    def instructions(self) -> str | None:
        "access:instructions"
        self._check_field("access:instructions")
        if "access:instructions" in self.properties:
            return cast("str | None", self.properties["access:instructions"])
        return cast("str | None", self._get_property("access:instructions", object))

    @instructions.setter
    def instructions(self, value: str | None) -> None:
        self._check_field("access:instructions")
        self._set_property("access:instructions", _encode(value))

    @property
    def restrictions(
        self,
    ) -> (
        list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | None
    ):
        "access:restrictions"
        self._check_field("access:restrictions")
        if "access:restrictions" in self.properties:
            return cast(
                "list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None",
                self.properties["access:restrictions"],
            )
        return cast(
            "list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None",
            self._get_property("access:restrictions", object),
        )

    @restrictions.setter
    def restrictions(
        self,
        value: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | None,
    ) -> None:
        self._check_field("access:restrictions")
        self._set_property("access:restrictions", _encode(value))

    @property
    def retrieval_time(self) -> str | None:
        "access:retrieval_time"
        self._check_field("access:retrieval_time")
        if "access:retrieval_time" in self.properties:
            return cast("str | None", self.properties["access:retrieval_time"])
        return cast("str | None", self._get_property("access:retrieval_time", object))

    @retrieval_time.setter
    def retrieval_time(self, value: str | None) -> None:
        self._check_field("access:retrieval_time")
        self._set_property("access:retrieval_time", _encode(value))

    @property
    def type(
        self,
    ) -> Literal["open", "embargoed", "restricted", "closed"] | Literal["restricted"] | None:
        "access:type"
        self._check_field("access:type")
        if "access:type" in self.properties:
            return cast(
                "Literal['open', 'embargoed', 'restricted', 'closed'] | Literal['restricted'] | None",
                self.properties["access:type"],
            )
        return cast(
            "Literal['open', 'embargoed', 'restricted', 'closed'] | Literal['restricted'] | None",
            self._get_property("access:type", object),
        )

    @type.setter
    def type(
        self,
        value: Literal["open", "embargoed", "restricted", "closed"] | Literal["restricted"] | None,
    ) -> None:
        self._check_field("access:type")
        self._set_property("access:type", _encode(value))

    @property
    def alternate(self) -> dict[str, Alternate] | None:
        "alternate"
        self._check_field("alternate")
        if "alternate" in self.properties:
            return cast(
                "dict[str, Alternate] | None",
                _decode(self.properties["alternate"], ["map", ["object", "Alternate"]]),
            )
        return cast(
            "dict[str, Alternate] | None",
            _decode(self._get_property("alternate", object), ["map", ["object", "Alternate"]]),
        )

    @alternate.setter
    def alternate(self, value: dict[str, Alternate] | None) -> None:
        self._check_field("alternate")
        self._set_property("alternate", _encode(value))

    @property
    def assetTemplates(self) -> dict[str, AssetFields] | None:
        "assetTemplates"
        self._check_field("assetTemplates")
        if "assetTemplates" in self.properties:
            return cast(
                "dict[str, AssetFields] | None",
                _decode(self.properties["assetTemplates"], ["map", ["object", "AssetFields"]]),
            )
        return cast(
            "dict[str, AssetFields] | None",
            _decode(
                self._get_property("assetTemplates", object), ["map", ["object", "AssetFields"]]
            ),
        )

    @assetTemplates.setter
    def assetTemplates(self, value: dict[str, AssetFields] | None) -> None:
        self._check_field("assetTemplates")
        self._set_property("assetTemplates", _encode(value))

    @property
    def linkTemplates(self) -> list[Alternate] | None:
        "linkTemplates"
        self._check_field("linkTemplates")
        if "linkTemplates" in self.properties:
            return cast(
                "list[Alternate] | None",
                _decode(self.properties["linkTemplates"], ["list", ["object", "Alternate"]]),
            )
        return cast(
            "list[Alternate] | None",
            _decode(self._get_property("linkTemplates", object), ["list", ["object", "Alternate"]]),
        )

    @linkTemplates.setter
    def linkTemplates(self, value: list[Alternate] | None) -> None:
        self._check_field("linkTemplates")
        self._set_property("linkTemplates", _encode(value))

    @classmethod
    def summaries(
        cls, obj: pystac.Collection, add_if_missing: bool = False
    ) -> SummariesAccessExtension:
        """Wrap schema-declared Collection summaries and optionally register the extension."""
        if not isinstance(obj, pystac.Collection):
            raise pystac.ExtensionTypeError("Summaries require a Collection")
        cls.ensure_has_extension(obj, add_if_missing)
        return SummariesAccessExtension(obj)

alternate: dict[str, Alternate] | None property writable

alternate

assetTemplates: dict[str, AssetFields] | None property writable

assetTemplates

availability: Literal['online', 'nearline', 'offline'] | None property writable

access:availability

instructions: str | None property writable

access:instructions

linkTemplates: list[Alternate] | None property writable

linkTemplates

restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None property writable

access:restrictions

retrieval_time: str | None property writable

access:retrieval_time

type: Literal['open', 'embargoed', 'restricted', 'closed'] | Literal['restricted'] | None property writable

access:type

__init__(obj: T, target: str) -> None

Bind a schema-supported STAC object's metadata for live updates.

Source code in pystac/extensions/access.py
561
562
563
564
565
566
567
568
569
570
571
def __init__(self, obj: T, target: str) -> None:
    """Bind a schema-supported STAC object's metadata for live updates."""
    self.obj: T = obj
    self._target = target
    self.additional_read_properties: list[dict[str, Any]] | None = None
    if isinstance(obj, (pystac.Item, pystac.ItemAssetDefinition)):
        self.properties = obj.properties
    else:
        self.properties = obj.extra_fields
    if isinstance(obj, pystac.Asset) and isinstance(obj.owner, pystac.Item):
        self.additional_read_properties = [obj.owner.properties]

apply(**values: Any) -> None

Update only supplied fields; omitted fields are preserved.

Keys are generated Python attribute names. Unknown or inapplicable fields are rejected before mutation. Validate the STAC object to check values afterwards.

Source code in pystac/extensions/access.py
609
610
611
612
613
614
615
616
617
618
619
620
def apply(self, **values: Any) -> None:
    """Update only supplied fields; omitted fields are preserved.

    Keys are generated Python attribute names. Unknown or inapplicable fields
    are rejected before mutation. Validate the STAC object to check values afterwards.
    """
    for name in values:
        if name not in FIELD_NAMES:
            raise TypeError(f"Unknown extension field: {name}")
        self._check_field(FIELD_NAMES[name])
    for name, value in values.items():
        setattr(self, name, value)

clear(name: str) -> None

Remove a field using its generated Python attribute name.

Source code in pystac/extensions/access.py
597
598
599
600
601
def clear(self, name: str) -> None:
    """Remove a field using its generated Python attribute name."""
    key = FIELD_NAMES[name]
    self._check_field(key)
    self.properties.pop(key, None)

ext(obj: T, add_if_missing: bool = False) -> AccessExtension[T] classmethod

Wrap a schema-supported object and optionally register its extension.

Source code in pystac/extensions/access.py
583
584
585
586
587
588
589
590
591
@classmethod
def ext(cls, obj: T, add_if_missing: bool = False) -> AccessExtension[T]:
    """Wrap a schema-supported object and optionally register its extension."""
    target = _target_for(obj)
    if isinstance(obj, (pystac.Asset, pystac.ItemAssetDefinition, pystac.Link)):
        cls.ensure_owner_has_extension(obj, add_if_missing)
    else:
        cls.ensure_has_extension(obj, add_if_missing)
    return cls(obj, target)

get_schema_uri() -> str classmethod

The canonical schema identifier used for extension registration.

Source code in pystac/extensions/access.py
573
574
575
576
@classmethod
def get_schema_uri(cls) -> str:
    """The canonical schema identifier used for extension registration."""
    return SCHEMA_URI

has_extension(obj: pystac.STACObject) -> bool classmethod

Check this exact schema version; migrations are not generated.

Source code in pystac/extensions/access.py
578
579
580
581
@classmethod
def has_extension(cls, obj: pystac.STACObject) -> bool:
    """Check this exact schema version; migrations are not generated."""
    return SCHEMA_URI in (obj.stac_extensions or [])

set_null(name: str) -> None

Write explicit JSON null; schema validation checks whether it is permitted.

Source code in pystac/extensions/access.py
603
604
605
606
607
def set_null(self, name: str) -> None:
    """Write explicit JSON null; schema validation checks whether it is permitted."""
    key = FIELD_NAMES[name]
    self._check_field(key)
    self._set_property(key, None, pop_if_none=False)

summaries(obj: pystac.Collection, add_if_missing: bool = False) -> SummariesAccessExtension classmethod

Wrap schema-declared Collection summaries and optionally register the extension.

Source code in pystac/extensions/access.py
786
787
788
789
790
791
792
793
794
@classmethod
def summaries(
    cls, obj: pystac.Collection, add_if_missing: bool = False
) -> SummariesAccessExtension:
    """Wrap schema-declared Collection summaries and optionally register the extension."""
    if not isinstance(obj, pystac.Collection):
        raise pystac.ExtensionTypeError("Summaries require a Collection")
    cls.ensure_has_extension(obj, add_if_missing)
    return SummariesAccessExtension(obj)

Alternate dataclass

Bases: _Object

Generated nested value object; unknown JSON members are preserved.

Source code in pystac/extensions/access.py
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
class Alternate(_Object):
    """Generated nested value object; unknown JSON members are preserved."""

    _members: ClassVar[dict[str, str]] = {
        "availability": "access:availability",
        "instructions": "access:instructions",
        "restrictions": "access:restrictions",
        "retrieval_time": "access:retrieval_time",
        "type": "access:type",
    }

    @classmethod
    def create(
        cls,
        *,
        availability: Literal["online", "nearline", "offline"] | _Unset = _UNSET,
        instructions: str | _Unset = _UNSET,
        restrictions: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | _Unset = _UNSET,
        retrieval_time: str | _Unset = _UNSET,
        type: Literal["open", "embargoed", "restricted", "closed"] | _Unset = _UNSET,
    ) -> Alternate:
        """Create with typed members; omitted optionals are not written.

        Explicit None writes null. Validate the STAC object to check value constraints.
        """
        _values = {
            "access:availability": availability,
            "access:instructions": instructions,
            "access:restrictions": restrictions,
            "access:retrieval_time": retrieval_time,
            "access:type": type,
        }
        return cls(
            {key: _encode(value) for key, value in _values.items() if not isinstance(value, _Unset)}
        )

    def apply(
        self,
        *,
        availability: Literal["online", "nearline", "offline"] | _Unset | None = _UNSET,
        instructions: str | _Unset | None = _UNSET,
        restrictions: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | _Unset
        | None = _UNSET,
        retrieval_time: str | _Unset | None = _UNSET,
        type: Literal["open", "embargoed", "restricted", "closed"] | _Unset | None = _UNSET,
    ) -> None:
        """Update supplied members; omitted values are preserved and None removes."""
        self._apply(
            {
                "availability": availability,
                "instructions": instructions,
                "restrictions": restrictions,
                "retrieval_time": retrieval_time,
                "type": type,
            }
        )

    @property
    def availability(self) -> Literal["online", "nearline", "offline"] | None:
        "access:availability"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "Literal['online', 'nearline', 'offline'] | None",
            self.properties.get("access:availability"),
        )

    @availability.setter
    def availability(self, value: Literal["online", "nearline", "offline"] | None) -> None:
        if value is None:
            self.properties.pop("access:availability", None)
        else:
            self.properties["access:availability"] = _encode(value)

    @property
    def instructions(self) -> str | None:
        "access:instructions"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast("str | None", self.properties.get("access:instructions"))

    @instructions.setter
    def instructions(self, value: str | None) -> None:
        if value is None:
            self.properties.pop("access:instructions", None)
        else:
            self.properties["access:instructions"] = _encode(value)

    @property
    def restrictions(
        self,
    ) -> (
        list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | None
    ):
        "access:restrictions"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None",
            self.properties.get("access:restrictions"),
        )

    @restrictions.setter
    def restrictions(
        self,
        value: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | None,
    ) -> None:
        if value is None:
            self.properties.pop("access:restrictions", None)
        else:
            self.properties["access:restrictions"] = _encode(value)

    @property
    def retrieval_time(self) -> str | None:
        "access:retrieval_time"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast("str | None", self.properties.get("access:retrieval_time"))

    @retrieval_time.setter
    def retrieval_time(self, value: str | None) -> None:
        if value is None:
            self.properties.pop("access:retrieval_time", None)
        else:
            self.properties["access:retrieval_time"] = _encode(value)

    @property
    def type(self) -> Literal["open", "embargoed", "restricted", "closed"] | None:
        "access:type"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "Literal['open', 'embargoed', 'restricted', 'closed'] | None",
            self.properties.get("access:type"),
        )

    @type.setter
    def type(self, value: Literal["open", "embargoed", "restricted", "closed"] | None) -> None:
        if value is None:
            self.properties.pop("access:type", None)
        else:
            self.properties["access:type"] = _encode(value)

availability: Literal['online', 'nearline', 'offline'] | None property writable

access:availability

instructions: str | None property writable

access:instructions

restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None property writable

access:restrictions

retrieval_time: str | None property writable

access:retrieval_time

type: Literal['open', 'embargoed', 'restricted', 'closed'] | None property writable

access:type

apply(*, availability: Literal['online', 'nearline', 'offline'] | _Unset | None = _UNSET, instructions: str | _Unset | None = _UNSET, restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | _Unset | None = _UNSET, retrieval_time: str | _Unset | None = _UNSET, type: Literal['open', 'embargoed', 'restricted', 'closed'] | _Unset | None = _UNSET) -> None

Update supplied members; omitted values are preserved and None removes.

Source code in pystac/extensions/access.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
def apply(
    self,
    *,
    availability: Literal["online", "nearline", "offline"] | _Unset | None = _UNSET,
    instructions: str | _Unset | None = _UNSET,
    restrictions: list[
        Literal[
            "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
        ]
    ]
    | _Unset
    | None = _UNSET,
    retrieval_time: str | _Unset | None = _UNSET,
    type: Literal["open", "embargoed", "restricted", "closed"] | _Unset | None = _UNSET,
) -> None:
    """Update supplied members; omitted values are preserved and None removes."""
    self._apply(
        {
            "availability": availability,
            "instructions": instructions,
            "restrictions": restrictions,
            "retrieval_time": retrieval_time,
            "type": type,
        }
    )

clear(name: str) -> None

Remove a member using its Python attribute name.

Source code in pystac/extensions/access.py
192
193
194
def clear(self, name: str) -> None:
    """Remove a member using its Python attribute name."""
    self.properties.pop(self._members[name], None)

create(*, availability: Literal['online', 'nearline', 'offline'] | _Unset = _UNSET, instructions: str | _Unset = _UNSET, restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | _Unset = _UNSET, retrieval_time: str | _Unset = _UNSET, type: Literal['open', 'embargoed', 'restricted', 'closed'] | _Unset = _UNSET) -> Alternate classmethod

Create with typed members; omitted optionals are not written.

Explicit None writes null. Validate the STAC object to check value constraints.

Source code in pystac/extensions/access.py
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
@classmethod
def create(
    cls,
    *,
    availability: Literal["online", "nearline", "offline"] | _Unset = _UNSET,
    instructions: str | _Unset = _UNSET,
    restrictions: list[
        Literal[
            "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
        ]
    ]
    | _Unset = _UNSET,
    retrieval_time: str | _Unset = _UNSET,
    type: Literal["open", "embargoed", "restricted", "closed"] | _Unset = _UNSET,
) -> Alternate:
    """Create with typed members; omitted optionals are not written.

    Explicit None writes null. Validate the STAC object to check value constraints.
    """
    _values = {
        "access:availability": availability,
        "access:instructions": instructions,
        "access:restrictions": restrictions,
        "access:retrieval_time": retrieval_time,
        "access:type": type,
    }
    return cls(
        {key: _encode(value) for key, value in _values.items() if not isinstance(value, _Unset)}
    )

from_dict(properties: dict[str, Any], *, copy: bool = False) -> _O classmethod

Wrap by reference, or request an independent copy.

Source code in pystac/extensions/access.py
172
173
174
175
176
177
@classmethod
def from_dict(cls: type[_O], properties: dict[str, Any], *, copy: bool = False) -> _O:
    """Wrap by reference, or request an independent copy."""
    from copy import deepcopy

    return cls(deepcopy(properties) if copy else properties)

set_null(name: str) -> None

Store explicit JSON null using a Python member name.

Source code in pystac/extensions/access.py
196
197
198
def set_null(self, name: str) -> None:
    """Store explicit JSON null using a Python member name."""
    self.properties[self._members[name]] = None

to_dict() -> dict[str, Any]

Return the live backing JSON dictionary, as PySTAC Render does.

Source code in pystac/extensions/access.py
179
180
181
def to_dict(self) -> dict[str, Any]:
    """Return the live backing JSON dictionary, as PySTAC Render does."""
    return self.properties

AssetFields dataclass

Bases: _Object

Generated nested value object; unknown JSON members are preserved.

Source code in pystac/extensions/access.py
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
class AssetFields(_Object):
    """Generated nested value object; unknown JSON members are preserved."""

    _members: ClassVar[dict[str, str]] = {
        "availability": "access:availability",
        "instructions": "access:instructions",
        "restrictions": "access:restrictions",
        "retrieval_time": "access:retrieval_time",
        "type": "access:type",
        "alternate": "alternate",
    }

    @classmethod
    def create(
        cls,
        *,
        availability: Literal["online", "nearline", "offline"] | _Unset = _UNSET,
        instructions: str | _Unset = _UNSET,
        restrictions: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | _Unset = _UNSET,
        retrieval_time: str | _Unset = _UNSET,
        type: Literal["open", "embargoed", "restricted", "closed"] | _Unset = _UNSET,
        alternate: dict[str, Alternate] | _Unset = _UNSET,
    ) -> AssetFields:
        """Create with typed members; omitted optionals are not written.

        Explicit None writes null. Validate the STAC object to check value constraints.
        """
        _values = {
            "access:availability": availability,
            "access:instructions": instructions,
            "access:restrictions": restrictions,
            "access:retrieval_time": retrieval_time,
            "access:type": type,
            "alternate": alternate,
        }
        return cls(
            {key: _encode(value) for key, value in _values.items() if not isinstance(value, _Unset)}
        )

    def apply(
        self,
        *,
        availability: Literal["online", "nearline", "offline"] | _Unset | None = _UNSET,
        instructions: str | _Unset | None = _UNSET,
        restrictions: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | _Unset
        | None = _UNSET,
        retrieval_time: str | _Unset | None = _UNSET,
        type: Literal["open", "embargoed", "restricted", "closed"] | _Unset | None = _UNSET,
        alternate: dict[str, Alternate] | _Unset | None = _UNSET,
    ) -> None:
        """Update supplied members; omitted values are preserved and None removes."""
        self._apply(
            {
                "availability": availability,
                "instructions": instructions,
                "restrictions": restrictions,
                "retrieval_time": retrieval_time,
                "type": type,
                "alternate": alternate,
            }
        )

    @property
    def availability(self) -> Literal["online", "nearline", "offline"] | None:
        "access:availability"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "Literal['online', 'nearline', 'offline'] | None",
            self.properties.get("access:availability"),
        )

    @availability.setter
    def availability(self, value: Literal["online", "nearline", "offline"] | None) -> None:
        if value is None:
            self.properties.pop("access:availability", None)
        else:
            self.properties["access:availability"] = _encode(value)

    @property
    def instructions(self) -> str | None:
        "access:instructions"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast("str | None", self.properties.get("access:instructions"))

    @instructions.setter
    def instructions(self, value: str | None) -> None:
        if value is None:
            self.properties.pop("access:instructions", None)
        else:
            self.properties["access:instructions"] = _encode(value)

    @property
    def restrictions(
        self,
    ) -> (
        list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | None
    ):
        "access:restrictions"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None",
            self.properties.get("access:restrictions"),
        )

    @restrictions.setter
    def restrictions(
        self,
        value: list[
            Literal[
                "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
            ]
        ]
        | None,
    ) -> None:
        if value is None:
            self.properties.pop("access:restrictions", None)
        else:
            self.properties["access:restrictions"] = _encode(value)

    @property
    def retrieval_time(self) -> str | None:
        "access:retrieval_time"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast("str | None", self.properties.get("access:retrieval_time"))

    @retrieval_time.setter
    def retrieval_time(self, value: str | None) -> None:
        if value is None:
            self.properties.pop("access:retrieval_time", None)
        else:
            self.properties["access:retrieval_time"] = _encode(value)

    @property
    def type(self) -> Literal["open", "embargoed", "restricted", "closed"] | None:
        "access:type"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "Literal['open', 'embargoed', 'restricted', 'closed'] | None",
            self.properties.get("access:type"),
        )

    @type.setter
    def type(self, value: Literal["open", "embargoed", "restricted", "closed"] | None) -> None:
        if value is None:
            self.properties.pop("access:type", None)
        else:
            self.properties["access:type"] = _encode(value)

    @property
    def alternate(self) -> dict[str, Alternate] | None:
        "alternate"
        # Schema-derived typing at the unvalidated PySTAC JSON boundary.
        return cast(
            "dict[str, Alternate] | None",
            _decode(self.properties.get("alternate"), ["map", ["object", "Alternate"]]),
        )

    @alternate.setter
    def alternate(self, value: dict[str, Alternate] | None) -> None:
        if value is None:
            self.properties.pop("alternate", None)
        else:
            self.properties["alternate"] = _encode(value)

alternate: dict[str, Alternate] | None property writable

alternate

availability: Literal['online', 'nearline', 'offline'] | None property writable

access:availability

instructions: str | None property writable

access:instructions

restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | None property writable

access:restrictions

retrieval_time: str | None property writable

access:retrieval_time

type: Literal['open', 'embargoed', 'restricted', 'closed'] | None property writable

access:type

apply(*, availability: Literal['online', 'nearline', 'offline'] | _Unset | None = _UNSET, instructions: str | _Unset | None = _UNSET, restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | _Unset | None = _UNSET, retrieval_time: str | _Unset | None = _UNSET, type: Literal['open', 'embargoed', 'restricted', 'closed'] | _Unset | None = _UNSET, alternate: dict[str, Alternate] | _Unset | None = _UNSET) -> None

Update supplied members; omitted values are preserved and None removes.

Source code in pystac/extensions/access.py
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
def apply(
    self,
    *,
    availability: Literal["online", "nearline", "offline"] | _Unset | None = _UNSET,
    instructions: str | _Unset | None = _UNSET,
    restrictions: list[
        Literal[
            "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
        ]
    ]
    | _Unset
    | None = _UNSET,
    retrieval_time: str | _Unset | None = _UNSET,
    type: Literal["open", "embargoed", "restricted", "closed"] | _Unset | None = _UNSET,
    alternate: dict[str, Alternate] | _Unset | None = _UNSET,
) -> None:
    """Update supplied members; omitted values are preserved and None removes."""
    self._apply(
        {
            "availability": availability,
            "instructions": instructions,
            "restrictions": restrictions,
            "retrieval_time": retrieval_time,
            "type": type,
            "alternate": alternate,
        }
    )

clear(name: str) -> None

Remove a member using its Python attribute name.

Source code in pystac/extensions/access.py
192
193
194
def clear(self, name: str) -> None:
    """Remove a member using its Python attribute name."""
    self.properties.pop(self._members[name], None)

create(*, availability: Literal['online', 'nearline', 'offline'] | _Unset = _UNSET, instructions: str | _Unset = _UNSET, restrictions: list[Literal['registration', 'agreement', 'data_fee', 'transfer_fee', 'membership', 'approval']] | _Unset = _UNSET, retrieval_time: str | _Unset = _UNSET, type: Literal['open', 'embargoed', 'restricted', 'closed'] | _Unset = _UNSET, alternate: dict[str, Alternate] | _Unset = _UNSET) -> AssetFields classmethod

Create with typed members; omitted optionals are not written.

Explicit None writes null. Validate the STAC object to check value constraints.

Source code in pystac/extensions/access.py
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
@classmethod
def create(
    cls,
    *,
    availability: Literal["online", "nearline", "offline"] | _Unset = _UNSET,
    instructions: str | _Unset = _UNSET,
    restrictions: list[
        Literal[
            "registration", "agreement", "data_fee", "transfer_fee", "membership", "approval"
        ]
    ]
    | _Unset = _UNSET,
    retrieval_time: str | _Unset = _UNSET,
    type: Literal["open", "embargoed", "restricted", "closed"] | _Unset = _UNSET,
    alternate: dict[str, Alternate] | _Unset = _UNSET,
) -> AssetFields:
    """Create with typed members; omitted optionals are not written.

    Explicit None writes null. Validate the STAC object to check value constraints.
    """
    _values = {
        "access:availability": availability,
        "access:instructions": instructions,
        "access:restrictions": restrictions,
        "access:retrieval_time": retrieval_time,
        "access:type": type,
        "alternate": alternate,
    }
    return cls(
        {key: _encode(value) for key, value in _values.items() if not isinstance(value, _Unset)}
    )

from_dict(properties: dict[str, Any], *, copy: bool = False) -> _O classmethod

Wrap by reference, or request an independent copy.

Source code in pystac/extensions/access.py
172
173
174
175
176
177
@classmethod
def from_dict(cls: type[_O], properties: dict[str, Any], *, copy: bool = False) -> _O:
    """Wrap by reference, or request an independent copy."""
    from copy import deepcopy

    return cls(deepcopy(properties) if copy else properties)

set_null(name: str) -> None

Store explicit JSON null using a Python member name.

Source code in pystac/extensions/access.py
196
197
198
def set_null(self, name: str) -> None:
    """Store explicit JSON null using a Python member name."""
    self.properties[self._members[name]] = None

to_dict() -> dict[str, Any]

Return the live backing JSON dictionary, as PySTAC Render does.

Source code in pystac/extensions/access.py
179
180
181
def to_dict(self) -> dict[str, Any]:
    """Return the live backing JSON dictionary, as PySTAC Render does."""
    return self.properties

SummariesAccessExtension

Bases: SummariesExtension

Collection summaries; ranges, lists and JSON Schema objects are preserved.

Source code in pystac/extensions/access.py
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
class SummariesAccessExtension(SummariesExtension):
    """Collection summaries; ranges, lists and JSON Schema objects are preserved."""

    @property
    def availability(self) -> list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None:
        value = self.summaries.to_dict().get("access:availability")
        if isinstance(value, dict) and "minimum" in value and "maximum" in value:
            return self.summaries.get_range("access:availability")
        return value

    @availability.setter
    def availability(
        self, value: list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None
    ) -> None:
        self.summaries.remove("access:availability")
        self._set_summary("access:availability", value)

    @property
    def instructions(self) -> list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None:
        value = self.summaries.to_dict().get("access:instructions")
        if isinstance(value, dict) and "minimum" in value and "maximum" in value:
            return self.summaries.get_range("access:instructions")
        return value

    @instructions.setter
    def instructions(
        self, value: list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None
    ) -> None:
        self.summaries.remove("access:instructions")
        self._set_summary("access:instructions", value)

    @property
    def restrictions(self) -> list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None:
        value = self.summaries.to_dict().get("access:restrictions")
        if isinstance(value, dict) and "minimum" in value and "maximum" in value:
            return self.summaries.get_range("access:restrictions")
        return value

    @restrictions.setter
    def restrictions(
        self, value: list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None
    ) -> None:
        self.summaries.remove("access:restrictions")
        self._set_summary("access:restrictions", value)

    @property
    def retrieval_time(self) -> list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None:
        value = self.summaries.to_dict().get("access:retrieval_time")
        if isinstance(value, dict) and "minimum" in value and "maximum" in value:
            return self.summaries.get_range("access:retrieval_time")
        return value

    @retrieval_time.setter
    def retrieval_time(
        self, value: list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None
    ) -> None:
        self.summaries.remove("access:retrieval_time")
        self._set_summary("access:retrieval_time", value)

    @property
    def type(self) -> list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None:
        value = self.summaries.to_dict().get("access:type")
        if isinstance(value, dict) and "minimum" in value and "maximum" in value:
            return self.summaries.get_range("access:type")
        return value

    @type.setter
    def type(self, value: list[Any] | pystac.RangeSummary[Any] | dict[str, Any] | None) -> None:
        self.summaries.remove("access:type")
        self._set_summary("access:type", value)