diff --git a/docs/source/hooks/common_use_cases.md b/docs/source/hooks/common_use_cases.md index 085bcf7136..c7070a6671 100644 --- a/docs/source/hooks/common_use_cases.md +++ b/docs/source/hooks/common_use_cases.md @@ -200,3 +200,17 @@ HOOKS = (AzureSecretsHook(),) ```{note} Note: `DefaultAzureCredential()` is Azure's recommended approach to authorise access to data in your storage accounts. For more information, consult the [documentation about how to authenticate to Azure and authorize access to blob data](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python). ``` + +## Use a Hook to read `metadata` from `DataCatalog` +Use the `after_catalog_created` Hook to access `metadata` to extend Kedro. + +```python +class MetadataHook: + @hook_impl + def after_catalog_created( + self, + catalog: DataCatalog, + ): + for dataset_name, dataset in catalog.datasets.__dict__.items(): + print(f"{dataset_name} metadata: \n {str(dataset.metadata)}") +```