Metadata Store API
Interface
- tatm.data.metadata_store.get_metadata(name: str) str
Get metadata for a dataset by name.
- Parameters:
name – Name of the dataset to lookup.
- Returns:
JSON representation of the metadata.
- Return type:
str
- tatm.data.metadata_store.reset_backend() None
Reset the metadata store backend. Used for testing and for reloading the backend if the config changes.
Backend Implementations
JSON Metadata Backend
- class tatm.data.metadata_store.metadata_backend.JsonTatmMetadataStoreBackend(metadata_store_path: str, *args, **kwargs)
Bases:
TatmMetadataStoreBackend
- lookup(name: str) str
Lookup metadata for a dataset by name. Should return a string containing a json representation of the metadata.
- Parameters:
name – Name of the dataset to lookup.
- Returns:
JSON representation of the metadata.
- Return type:
str
- class tatm.data.metadata_store.metadata_backend.TatmMetadataStoreBackend(*args, **kwargs)
Bases:
ABC
Abstract class for metadata store backend. Responsible for storing and retrieving metadata.
- abstract lookup(name: str) str
Lookup metadata for a dataset by name. Should return a string containing a json representation of the metadata.
- Parameters:
name – Name of the dataset to lookup.
- Raises:
KeyError – If metadata is not found for the dataset.
- Returns:
JSON representation of the metadata.
- Return type:
str
OpenMetadata Backend
- class tatm.data.metadata_store.open_metadata_backend.OpenMetadataTatmMetadataStoreBackend(address: str, api_key: str, data_service_name='tatm-data-service', *args, **kwargs)
Bases:
TatmMetadataStoreBackend
- lookup(name: str) str
Lookup metadata for a dataset by name. Should return a string containing a json representation of the metadata.
- Parameters:
name – Name of the dataset to lookup.
- Raises:
KeyError – If metadata is not found for the dataset.
- Returns:
JSON representation of the metadata.
- Return type:
str