Module Functions
ipfs_stac.client.fetchCID(cid)
Fetches data from CID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cid
|
str
|
CID to retrieve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
Retrieved data. |
ipfs_stac.client.ensure_data_fetched(func)
Decorator that ensures data is fetched before executing the decorated method.
This decorator checks if the data attribute of the instance is None. If it is,
it calls the fetch method to retrieve the data before proceeding to call the
decorated method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable[..., Any]
|
The method to be decorated. |
required |
Returns:
| Type | Description |
|---|---|
Callable[..., Any]
|
Callable[..., Any]: The wrapped method that ensures data is fetched. |