NovaGuide / src /utils /ids.py
DKLPDV15\eB
Deploy NovaGuide with versioned runtime configuration
7ca0188
Raw History Blame Contribute Delete
598 Bytes
"""Identifier helpers for sessions, interactions, and analytics events."""
from uuid import uuid4
def generate_event_id(prefix: str) -> str:
"""Generate a UUID4 identifier with a readable, normalised prefix."""
clean_prefix = prefix.strip().rstrip("_") or "evt"
return f"{clean_prefix}_{uuid4()}"
def generate_session_id() -> str:
"""Generate a session identifier prefixed with ``sess_``."""
return generate_event_id("sess")
def generate_interaction_id() -> str:
"""Generate an interaction identifier prefixed with ``int_``."""
return generate_event_id("int")