diff --git a/helpers/none_helpers.py b/helpers/none_helpers.py new file mode 100644 index 0000000..db0ffe8 --- /dev/null +++ b/helpers/none_helpers.py @@ -0,0 +1,69 @@ +from typing import Dict, Optional +from pydantic import BaseModel, validator + +def validate_yoloo_message(message: str) -> bool: + """ + Validates if the yoloo message meets requirements. + + Args: + message: The message to validate + + Returns: + bool: True if message is valid, False otherwise + """ + if not message: + return False + if len(message) > 100: + return False + return True + +def format_yoloo_response(message: str = "yoloo!!") -> Dict[str, str]: + """ + Formats the yoloo message into a standard response format. + + Args: + message: The message to format + + Returns: + Dict containing formatted message + """ + return { + "message": message, + "status": "success" + } + +def get_default_yoloo() -> str: + """ + Returns the default yoloo message. + + Returns: + str: Default yoloo message + """ + return "yoloo!!" + +def sanitize_yoloo_message(message: str) -> str: + """ + Sanitizes the yoloo message by removing unwanted characters. + + Args: + message: Message to sanitize + + Returns: + str: Sanitized message + """ + # Remove special characters except ! and basic punctuation + sanitized = ''.join(c for c in message if c.isalnum() or c in "!.,? ") + return sanitized.strip() + +def transform_yoloo_case(message: str, to_upper: bool = False) -> str: + """ + Transforms the yoloo message case. + + Args: + message: Message to transform + to_upper: If True converts to uppercase, otherwise lowercase + + Returns: + str: Transformed message + """ + return message.upper() if to_upper else message.lower() \ No newline at end of file