datacatalog.identifiers.typeduuid package

Submodules

datacatalog.identifiers.typeduuid.convert module

datacatalog.identifiers.typeduuid.examples module

datacatalog.identifiers.typeduuid.schemas module

datacatalog.identifiers.typeduuid.schemas.get_schemas()[source]

datacatalog.identifiers.typeduuid.typeduuid module

class datacatalog.identifiers.typeduuid.typeduuid.TypedCatalogUUID(**kwargs)[source]

Bases: datacatalog.identifiers.typeduuid.uuidtypes.CatalogUUID

datacatalog.identifiers.typeduuid.typeduuid.binary_uuid_to_text(binary_uuid)[source]

Convert binary TypeUUID to its text representation

datacatalog.identifiers.typeduuid.typeduuid.catalog_uuid(text_value, uuid_type='generic', namespace=UUID('54765aeb-44ca-374a-9a9f-eb4658383ee4'), binary=False)[source]

Returns a TypedUUID5 for text_value

Parameters:
  • text_value (str) – the text string to encode as a UUID5
  • type (str, optional) – one the known datacatalog UUID types
Returns:

The new TypedUUID in string form

Return type:

str

datacatalog.identifiers.typeduuid.typeduuid.catalog_uuid_from_v1_uuid(v1_uuid, uuid_type='generic', binary=False)[source]
datacatalog.identifiers.typeduuid.typeduuid.generate(text_value=None, uuid_type=None, binary=False)[source]

Generate a TypedUUID of a specific type from a string

Parameters:
  • text_value (str) – A string to convert into an UUID
  • uuid_type (str, optional) – The type of UUID to return
Returns:

String representation of the generated UUID

Return type:

str

datacatalog.identifiers.typeduuid.typeduuid.get_uuidtype(query_uuid)[source]

Determine the class for a UUID

Parameters:query_uuid (str/uuid.uuid) – an TypedUUID
Raises:ValueError – Raised if the query cannot be resolved to a known UUID type
Returns:The TypedUUID class for the query
Return type:str
datacatalog.identifiers.typeduuid.typeduuid.listify_uuid(uuid, validate_members=True)[source]

Safely cast a string UUID into a list of UUIDs

datacatalog.identifiers.typeduuid.typeduuid.mock(text_value=None, uuid_type=None, binary=True)[source]

Generate a mock TypedUUID of a specific type from a string

Parameters:
  • text_value (str) – A string to convert into an UUID
  • uuid_type (str, optional) – The type of UUID to return
Returns:

String representation of the generated TypedUUID

Return type:

str

Note

UUID is in a different namespace and will not validate

datacatalog.identifiers.typeduuid.typeduuid.random_uuid5(binary=True)[source]

Generate a random TypedUUID

Returns:String representation of the random UUID
Return type:str
datacatalog.identifiers.typeduuid.typeduuid.text_uuid_to_binary(text_uuid)[source]

Convert text TypedUUID to binary form

datacatalog.identifiers.typeduuid.typeduuid.uuid_to_hashid(uuid_string, salt='xCPJ7PKTdp8BYYb4twh9xNYD')[source]

Convert a UUID to a HashId to save space. Good for file path building.

datacatalog.identifiers.typeduuid.typeduuid.validate(uuid_string, permissive=False)[source]

Validate whether a string is a TypedUUID

Parameters:
  • uuid_string (str) – the value to validate
  • permissive (bool, optional) – whether to return false or raise Exception on failure
Raises:

ValueError – The passed value was not an appId and permissive was False

Returns:

Validation result

Return type:

bool

datacatalog.identifiers.typeduuid.typeduuid.validate_type(type_string, permissive=False)[source]

Ensure a provided type string is valid

Parameters:
  • type_string (str) – String representing a known catalog type
  • permissive (vool, optional) – Return False or raise Exception on failure
Returns:

Whether the value is a known type

Return type:

bool

datacatalog.identifiers.typeduuid.typeduuid.validate_uuid5(uuid_string, permissive=False)[source]

Test whether a UUID string is a valid uuid.uuid5

datacatalog.identifiers.typeduuid.uuidtypes module

class datacatalog.identifiers.typeduuid.uuidtypes.CatalogUUID(**kwargs)[source]

Bases: datacatalog.jsonschemas.schema.JSONSchemaBaseObject

update_id()[source]

Dynamically builds schema.$id

Transforms self._filename into a schema.id URL in the current namespace.

class datacatalog.identifiers.typeduuid.uuidtypes.TypedUUID(*args)[source]

Bases: object

UUID identifying a catalog object and advertising its internal type