Cache¶
pyatlan.cache.atlan_tag_cache
¶
Classes¶
AtlanTagCache(client: AtlanClient)
¶
Lazily-loaded cache for translating between Atlan-internal ID strings and human-readable names for Atlan tags.
Source code in pyatlan/cache/atlan_tag_cache.py
Functions¶
get_id_for_name(name: str) -> Optional[str]
¶
Translate the provided human-readable Atlan tag name to its Atlan-internal ID string.
:param name: human-readable name of the Atlan tag :returns: Atlan-internal ID string of the Atlan tag
Source code in pyatlan/cache/atlan_tag_cache.py
get_name_for_id(idstr: str) -> Optional[str]
¶
Translate the provided Atlan-internal classification ID string to the human-readable Atlan tag name.
:param idstr: Atlan-internal ID string of the Atlan tag :returns: human-readable name of the Atlan tag
Source code in pyatlan/cache/atlan_tag_cache.py
get_source_tags_attr_id(id: str) -> Optional[str]
¶
Translate the provided Atlan-internal Atlan tag ID string to the Atlan-internal name of the attribute that captures tag attachment details (for source-synced tags).
:param id: Atlan-internal ID string of the Atlan tag :returns: Atlan-internal ID string of the attribute containing source-synced tag attachment details
Source code in pyatlan/cache/atlan_tag_cache.py
refresh_cache() -> None
¶
pyatlan.cache.custom_metadata_cache
¶
Classes¶
CustomMetadataCache(client: AtlanClient)
¶
Lazily-loaded cache for translating between Atlan-internal ID strings and human-readable names for custom metadata (including attributes).
Source code in pyatlan/cache/custom_metadata_cache.py
Functions¶
get_all_custom_attributes(include_deleted: bool = False, force_refresh: bool = False) -> Dict[str, List[AttributeDef]]
¶
Retrieve all the custom metadata attributes. The dict will be keyed by custom metadata set name, and the value will be a listing of all the attributes within that set (with all the details of each of those attributes).
:param include_deleted: if True, include the archived (deleted) custom attributes; otherwise only include active custom attributes :param force_refresh: if True, will refresh the custom metadata cache; if False, will only refresh the cache if it is empty :returns: a dict from custom metadata set name to all details about its attributes :raises NotFoundError: if the custom metadata cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
get_attr_id_for_name(set_name: str, attr_name: str) -> str
¶
Translate the provided human-readable custom metadata set and attribute names to the Atlan-internal ID string for the attribute.
:param set_name: human-readable name of the custom metadata set :param attr_name: human-readable name of the attribute :returns: Atlan-internal ID string for the attribute :raises NotFoundError: if the custom metadata attribute cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
get_attr_name_for_id(set_id: str, attr_id: str) -> str
¶
Given the Atlan-internal ID string for the set and the Atlan-internal ID for the attribute return the human-readable custom metadata name for the attribute.
:param set_id: Atlan-internal ID string for the custom metadata set :param attr_id: Atlan-internal ID string for the attribute :returns: human-readable name of the attribute :raises NotFoundError: if the custom metadata attribute cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
get_attribute_def(attr_id: str) -> AttributeDef
¶
Retrieve a specific custom metadata attribute definition by its unique Atlan-internal ID string.
:param attr_id: Atlan-internal ID string for the custom metadata attribute :returns: attribute definition for the custom metadata attribute :raises InvalidRequestError: if no attribute ID was provided :raises NotFoundError: if the custom metadata attribute cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
get_attribute_for_search_results(set_name: str, attr_name: str) -> Optional[str]
¶
Retrieve a single custom attribute name to include on search results.
:param set_name: human-readable name of the custom metadata set for which to retrieve the custom metadata attribute name :param attr_name: human-readable name of the attribute :returns: the attribute name, strictly useful for inclusion in search results
Source code in pyatlan/cache/custom_metadata_cache.py
get_attributes_for_search_results(set_name: str) -> Optional[List[str]]
¶
Retrieve the full set of custom attributes to include on search results.
:param set_name: human-readable name of the custom metadata set for which to retrieve attribute names :returns: a list of the attribute names, strictly useful for inclusion in search results
Source code in pyatlan/cache/custom_metadata_cache.py
get_custom_metadata_def(name: str) -> CustomMetadataDef
¶
Retrieve the full custom metadata structure definition.
:param name: human-readable name of the custom metadata set :returns: the full custom metadata structure definition for that set :raises InvalidRequestError: if no name was provided :raises NotFoundError: if the custom metadata cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
get_id_for_name(name: str) -> str
¶
Translate the provided human-readable custom metadata set name to its Atlan-internal ID string.
:param name: human-readable name of the custom metadata set :returns: Atlan-internal ID string of the custom metadata set :raises InvalidRequestError: if no name was provided :raises NotFoundError: if the custom metadata cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
get_name_for_id(idstr: str) -> str
¶
Translate the provided Atlan-internal custom metadata ID string to the human-readable custom metadata set name.
:param idstr: Atlan-internal ID string of the custom metadata set :returns: human-readable name of the custom metadata set :raises InvalidRequestError: if no ID was provided :raises NotFoundError: if the custom metadata cannot be found
Source code in pyatlan/cache/custom_metadata_cache.py
is_attr_archived(attr_id: str) -> bool
¶
Determine if an attribute is archived :param attr_id: Atlan-internal ID string for the attribute :returns: True if the attribute has been archived
Source code in pyatlan/cache/custom_metadata_cache.py
refresh_cache() -> None
¶
Refreshes the cache of custom metadata structures by requesting the full set of custom metadata structures from Atlan. :raises LogicError: if duplicate custom attributes are detected
Source code in pyatlan/cache/custom_metadata_cache.py
pyatlan.cache.enum_cache
¶
Classes¶
EnumCache(client: AtlanClient)
¶
Lazily-loaded cache for accessing details of an enumeration.
Source code in pyatlan/cache/enum_cache.py
Functions¶
get_by_name(name: str) -> EnumDef
¶
Retrieve the enumeration definition by its name.
:param name: human-readable name of the enumeration.
:raises NotFoundError: if the enumeration with the given name does not exist.
:returns: enumeration definition
Source code in pyatlan/cache/enum_cache.py
refresh_cache() -> None
¶
Refreshes the cache of enumerations by requesting the full set of enumerations from Atlan.
Source code in pyatlan/cache/enum_cache.py
pyatlan.cache.group_cache
¶
Classes¶
GroupCache(client: AtlanClient)
¶
Lazily-loaded cache for translating Atlan-internal groups into their various IDs.
Source code in pyatlan/cache/group_cache.py
Functions¶
get_id_for_alias(alias: str) -> Optional[str]
¶
Translate the provided human-readable group name to its GUID.
:param alias: name of the group as it appears in the UI :returns: unique identifier (GUID) of the group
Source code in pyatlan/cache/group_cache.py
get_id_for_name(name: str) -> Optional[str]
¶
Translate the provided internal group name to its GUID.
:param name: human-readable name of the group :returns: unique identifier (GUID) of the group
Source code in pyatlan/cache/group_cache.py
get_name_for_id(idstr: str) -> Optional[str]
¶
Translate the provided group GUID to the internal group name.
:param idstr: unique identifier (GUID) of the group :returns: human-readable name of the group
Source code in pyatlan/cache/group_cache.py
validate_aliases(aliases: Iterable[str])
¶
Validate that the given (internal) group names are valid. A ValueError will be raised in any are not.
:param aliases: a collection of (internal) group names to be checked
Source code in pyatlan/cache/group_cache.py
pyatlan.cache.role_cache
¶
Classes¶
RoleCache(client: AtlanClient)
¶
Lazily-loaded cache for translating Atlan-internal roles into their various IDs.
Source code in pyatlan/cache/role_cache.py
Functions¶
get_id_for_name(name: str) -> Optional[str]
¶
Translate the provided human-readable role name to its GUID.
:param name: human-readable name of the role :returns: unique identifier (GUID) of the role
Source code in pyatlan/cache/role_cache.py
get_name_for_id(idstr: str) -> Optional[str]
¶
Translate the provided role GUID to the human-readable role name.
:param idstr: unique identifier (GUID) of the role :returns: human-readable name of the role
Source code in pyatlan/cache/role_cache.py
is_api_token_user() -> bool
¶
Check if the current user is authenticated via an API token or OAuth client. This method checks for the presence of $api-token-default-access or $admin roles.
:returns: True if the user is an API token user, False otherwise
Source code in pyatlan/cache/role_cache.py
validate_idstrs(idstrs: Iterable[str])
¶
Validate that the given role GUIDs are valid. A ValueError will be raised in any are not.
:param idstrs: a collection of unique identifiers (GUID) of the roles to be checked
Source code in pyatlan/cache/role_cache.py
pyatlan.cache.user_cache
¶
Classes¶
UserCache(client: AtlanClient)
¶
Lazily-loaded cache for translating Atlan-internal users into their various IDs.
Source code in pyatlan/cache/user_cache.py
Functions¶
get_id_for_email(email: str) -> Optional[str]
¶
Translate the provided email to its GUID.
:param email: email address of the user :returns: unique identifier (GUID) of the user
Source code in pyatlan/cache/user_cache.py
get_id_for_name(name: str) -> Optional[str]
¶
Translate the provided human-readable username to its GUID.
:param name: human-readable name of the user :returns: unique identifier (GUID) of the user
Source code in pyatlan/cache/user_cache.py
get_name_for_id(idstr: str) -> Optional[str]
¶
Translate the provided user GUID to the human-readable username.
:param idstr: unique identifier (GUID) of the user :returns: username of the user
Source code in pyatlan/cache/user_cache.py
validate_names(names: Iterable[str])
¶
Validate that the given human-readable usernames are valid. A ValueError will be raised in any are not.
:param names: a collection of usernames to be checked
Source code in pyatlan/cache/user_cache.py
pyatlan.cache.connection_cache
¶
Classes¶
ConnectionCache(client: AtlanClient)
¶
Bases: AbstractAssetCache
Lazily-loaded cache for translating between a connection's simplified name its details.
- guid = UUID of the connection for eg: 9c677e77-e01d-40e0-85b7-8ba4cd7d0ea9
- qualified_name = Atlan-internal name of the connection (with epoch) for eg: default/snowflake/1234567890
- name = simple name of the form {{connectorType}}/{{connectorName}}, for eg: snowflake/development
Source code in pyatlan/cache/connection_cache.py
Functions¶
get_by_guid(guid: str, allow_refresh: bool = True) -> Connection
¶
Retrieve a connection from the cache by its UUID. If the asset is not found, it will be looked up and added to the cache.
:param guid: UUID of the connection in Atlan for eg: 9c677e77-e01d-40e0-85b7-8ba4cd7d0ea9 :returns: connection (if found) :raises AtlanError: on any API communication problem if the cache needs to be refreshed :raises NotFoundError: if the connection cannot be found (does not exist) in Atlan :raises InvalidRequestError: if no UUID was provided for the connection to retrieve
Source code in pyatlan/cache/connection_cache.py
get_by_name(name: ConnectionName, allow_refresh: bool = True) -> Connection
¶
Retrieve an connection from the cache by its uniquely identifiable name.
:param name: uniquely identifiable name of the connection in Atlan
In the form of {{connectorType}}/{{connectorName}}
for eg: snowflake/development
:param allow_refresh: whether to allow a refresh of the cache (True) or not (False)
:returns: connection (if found)
:raises AtlanError: on any API communication problem if the cache needs to be refreshed
:raises NotFoundError: if the connection cannot be found (does not exist) in Atlan
:raises InvalidRequestError: if no name was provided for the connection to retrieve
Source code in pyatlan/cache/connection_cache.py
get_by_qualified_name(qualified_name: str, allow_refresh: bool = True) -> Connection
¶
Retrieve a connection from the cache by its unique Atlan-internal name.
:param qualified_name: unique Atlan-internal name of the connection
for eg: default/snowflake/1234567890
:param allow_refresh: whether to allow a refresh of the cache (True) or not (False)
:param qualified_name: unique Atlan-internal name of the connection
:returns: connection (if found)
:raises AtlanError: on any API communication problem if the cache needs to be refreshed
:raises NotFoundError: if the connection cannot be found (does not exist) in Atlan
:raises InvalidRequestError: if no qualified_name was provided for the connection to retrieve
Source code in pyatlan/cache/connection_cache.py
ConnectionName(connection: Union[str, Optional[Connection]] = None)
¶
Bases: AbstractAssetName
Unique identity for a connection, in the form: {{type}}/{{name}}
- For eg: snowflake/development
Source code in pyatlan/cache/connection_cache.py
pyatlan.cache.source_tag_cache
¶
Classes¶
SourceTagCache(client: AtlanClient)
¶
Bases: AbstractAssetCache
Lazily-loaded cache for translating between source-synced tags and the qualifiedName of such.
- guid = UUID of the source tag for eg: 9c677e77-e01d-40e0-85b7-8ba4cd7d0ea9
- qualified_name = of the source tag (with epoch) for eg: default/snowflake/1234567890/DB/SCHEMA/TAG_NAME
- name = simple name of the form {{connectorType}}/{{connectorName}}@@DB/SCHEMA/TAG_NAME for eg: snowflake/development@@DB/SCHEMA/TAG_NAME
Source code in pyatlan/cache/source_tag_cache.py
Functions¶
get_by_guid(guid: str, allow_refresh: bool = True) -> Tag
¶
Retrieve a source tag from the cache by its UUID. If the asset is not found, it will be looked up and added to the cache.
:param guid: UUID of the source tag in Atlan for eg: 9c677e77-e01d-40e0-85b7-8ba4cd7d0ea9 :returns: source tag (if found) :raises AtlanError: on any API communication problem if the cache needs to be refreshed :raises NotFoundError: if the source tag cannot be found (does not exist) in Atlan :raises InvalidRequestError: if no UUID was provided for the source tag to retrieve
Source code in pyatlan/cache/source_tag_cache.py
get_by_name(name: SourceTagName, allow_refresh: bool = True) -> Tag
¶
Retrieve an connection from the cache by its uniquely identifiable name.
:param name: uniquely identifiable name of the connection in Atlan.
In the form of {{connectorType}}/{{connectorName}}@@DB/SCHEMA/TAG_NAME
for eg: snowflake/development@@DB/SCHEMA/TAG_NAME
:param allow_refresh: whether to allow a refresh of the cache (True) or not (False)
:returns: the connection (if found)
:raises AtlanError: on any API communication problem if the cache needs to be refreshed
:raises NotFoundError: if the object cannot be found (does not exist) in Atlan
:raises InvalidRequestError: if no name was provided for the object to retrieve
Source code in pyatlan/cache/source_tag_cache.py
get_by_qualified_name(qualified_name: str, allow_refresh: bool = True) -> Tag
¶
Retrieve a source tag from the cache by its unique Atlan-internal name.
:param qualified_name: unique Atlan-internal name of the source tag
for eg: default/snowflake/1234567890/DB/SCHEMA/TAG_NAME
:param allow_refresh: whether to allow a refresh of the cache (True) or not (False)
:param qualified_name: unique Atlan-internal name of the source tag
:returns: source tag (if found)
:raises AtlanError: on any API communication problem if the cache needs to be refreshed
:raises NotFoundError: if the source tag cannot be found (does not exist) in Atlan
:raises InvalidRequestError: if no qualified_name was provided for the source tag to retrieve
Source code in pyatlan/cache/source_tag_cache.py
SourceTagName(client: AtlanClient, tag: Union[str, Asset])
¶
Bases: AbstractAssetName
Unique identity for a source tag, in the form: {{connectorType}}/{{connectorName}}@@DB/SCHEMA/TAG_NAME
- For eg: snowflake/development
Source code in pyatlan/cache/source_tag_cache.py
pyatlan.cache.abstract_asset_cache
¶
Classes¶
AbstractAssetCache(client: AtlanClient)
¶
Bases: ABC
Base class for reusable components that are common to all caches, where a cache is populated entry-by-entry.
Source code in pyatlan/cache/abstract_asset_cache.py
Functions¶
cache(asset: Asset)
¶
Add an entry to the cache.
:param asset: to be cached
Source code in pyatlan/cache/abstract_asset_cache.py
get_name(asset: Asset)
abstractmethod
¶
is_guid_known(guid: str) -> bool
¶
Checks whether the provided Atlan-internal UUID is known. NOTE: will not refresh the cache itself to determine this.
:param guid: Atlan-internal UUID of the object
:returns: True if the object is known, False otherwise
Source code in pyatlan/cache/abstract_asset_cache.py
is_name_known(name: str)
¶
Checks whether the provided Atlan-internal ID string is known. NOTE: will not refresh the cache itself to determine this.
:param name: human-constructable name of the object
:returns: True if the object is known, False otherwise
Source code in pyatlan/cache/abstract_asset_cache.py
is_qualified_name_known(qualified_name: str)
¶
Checks whether the provided Atlan-internal ID string is known. NOTE: will not refresh the cache itself to determine this.
:param qualified_name: Atlan-internal ID string of the object
:returns: True if the object is known, False otherwise
Source code in pyatlan/cache/abstract_asset_cache.py
lookup_by_guid(guid: str)
abstractmethod
¶
lookup_by_name(name: Any)
abstractmethod
¶
lookup_by_qualified_name(qualified_name: str)
abstractmethod
¶
pyatlan.cache.dq_template_config_cache
¶
Classes¶
DQTemplateConfigCache(client: AtlanClient)
¶
Lazily-loaded cache for DQ rule template configurations to avoid multiple API calls.
Source code in pyatlan/cache/dq_template_config_cache.py
Functions¶
get_template_config(rule_type: str) -> Optional[Dict]
¶
Get template configuration for a specific rule type.
:param rule_type: The name of the rule template :returns: Template configuration dict or None if not found
Source code in pyatlan/cache/dq_template_config_cache.py
refresh_cache() -> None
¶
Refreshes the cache of DQ template configurations by requesting the full set from Atlan.