Skip to content

IDs

generate_prefixed_uuid

Generate a UUID string with the given prefix.

Parameters:

Name Type Description Default
prefix str

The prefix to use for the UUID

required

Returns:

Type Description
str

A UUID string with the given prefix

Raises:

Type Description
ValueError

If the prefix contains an underscore

Example

Generate a UUID with the prefix "my_prefix"

from raggy.utilities.ids import generate_prefixed_uuid

uuid = generate_prefixed_uuid("schleeb") # 'schleeb_6be20040-b7e0-4990-b271-394221584a59'