Python API¶
Use VcsExtension.ext() for Catalogs, Collections, Items, Assets, and Links.
pystac.extensions.vcs
¶
Read and write VCS v0.1.0 metadata on PySTAC objects, assets, and links.
Use VcsExtension.ext(target, add_if_missing=True) to declare the extension
on a STAC object or the owner of an asset or link before setting its fields.
VCS_EXTENSION_HOOKS: ExtensionHooks = VcsExtensionHooks()
module-attribute
¶
SCHEMA_URI = 'https://stac-extensions.github.io/vcs/v0.1.0/schema.json'
module-attribute
¶
VcsExtension
¶
Bases: Generic[T], PropertiesExtension, ExtensionManagementMixin[Catalog | Collection | Item]
Access version-control metadata stored directly on a PySTAC target.
Catalogs and Collections store fields at the top level; Items use their
properties. Assets and Links use their own extra fields, without inheriting
metadata from their owners. Use ext() to check the schema declaration.
| Attributes: |
|
|---|
Source code in pystac/extensions/vcs.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
branch: str | None
property
writable
¶
The line of development, or None when absent.
revision: str | None
property
writable
¶
The exact revision identifier, or None when absent.
tag: str | None
property
writable
¶
The release marker, or None when absent.
vcs_type: str | None
property
writable
¶
The version-control system name, or None when absent.
__init__(obj: T) -> None
¶
Wrap a target's metadata without checking its extension declaration.
Source code in pystac/extensions/vcs.py
56 57 58 59 60 61 62 63 64 | |
apply(vcs_type: str | None = None, branch: str | None = None, revision: str | None = None, tag: str | None = None) -> None
¶
Replace all four VCS fields in place, clearing omitted fields.
| Parameters: |
|
|---|
Values are serialized as supplied; call STAC validation separately to enforce the schema's nonempty-string constraints.
Source code in pystac/extensions/vcs.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
ext(obj: T, add_if_missing: bool = False) -> VcsExtension[T]
classmethod
¶
Wrap a target after checking its VCS extension declaration.
| Parameters: |
|
|---|
| Raises: |
|
|---|
Source code in pystac/extensions/vcs.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
get_schema_uri() -> str
classmethod
¶
Return the VCS v0.1.0 schema identifier.
Source code in pystac/extensions/vcs.py
125 126 127 128 | |
VcsExtensionHooks
¶
Bases: ExtensionHooks
Identify VCS metadata for PySTAC extension migration hooks.
Source code in pystac/extensions/vcs.py
157 158 159 160 161 162 163 164 165 166 | |