You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

uuid_utils.py 231B

1234567891011
  1. import uuid
  2. def is_valid_uuid(uuid_str: str | None) -> bool:
  3. if uuid_str is None or len(uuid_str) == 0:
  4. return False
  5. try:
  6. uuid.UUID(uuid_str)
  7. return True
  8. except Exception:
  9. return False