bulk_transactions
stac_fastapi.extensions.bulk_transactions ¶
Fields extension module.
AsyncBaseBulkTransactionsClient ¶
Bases: ABC
BulkTransactionsClient.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
bulk_item_insert
abstractmethod
async
¶
bulk_item_insert(items: Items, **kwargs) -> BulkTransaction | Response
Bulk creation of items.
Parameters:
-
items(Items) –list of items.
Returns:
-
BulkTransaction | Response–Message indicating the status of the insert.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
BaseBulkTransactionsClient ¶
Bases: ABC
BulkTransactionsClient.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
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 | |
bulk_item_insert
abstractmethod
¶
bulk_item_insert(
items: Items, chunk_size: int | None = None, **kwargs
) -> BulkTransaction | Response
Bulk creation of items.
Parameters:
-
items(Items) –list of items.
-
chunk_size(int | None, default:None) –number of items processed at a time.
Returns:
-
BulkTransaction | Response–Message indicating the status of the insert.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
BulkTransaction ¶
Bases: TypedDict
Bulk Transaction Response.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
26 27 28 29 30 31 32 | |
BulkTransactionExtension ¶
Bases: ApiExtension
Bulk Transaction Extension.
Bulk Transaction extension adds the POST
/collections/{collection_id}/bulk_items endpoint to the application for
efficient bulk insertion of items. The input to this is an object with an
attribute "items", that has a value that is an object with a group of
attributes that are the ids of each Item, and the value is the Item entity.
Optionally, clients can specify a "method" attribute that is either "insert" or "upsert". If "insert", then the items will be inserted if they do not exist, and an error will be returned if they do. If "upsert", then the items will be inserted if they do not exist, and updated if they do. This defaults to "insert".
{
"items": {
"id1": { "type": "Feature", ... },
"id2": { "type": "Feature", ... },
"id3": { "type": "Feature", ... }
},
"method": "insert"
}
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
register ¶
register(app: FastAPI) -> None
Register the extension with a FastAPI application.
Parameters:
-
app(FastAPI) –target FastAPI application.
Returns:
-
None–None
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
BulkTransactionMethod ¶
Bases: StrEnum
Bulk Transaction Methods.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
51 52 53 54 55 | |
BulkTransactionModel ¶
Bases: BaseModel
Bulk Transaction Model.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
42 43 44 45 46 47 48 | |
Items ¶
Bases: BaseModel
A group of STAC Item objects, in the form of a dictionary from Item.id -> Item.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
58 59 60 61 62 63 64 65 66 | |
__iter__ ¶
__iter__()
Return an iterable of STAC Item objects.
Source code in stac_fastapi/extensions/stac_fastapi/extensions/bulk_transactions/bulk_transactions.py
64 65 66 | |