---------------------------------------------------------------------- This is the API documentation for the gdtest_sphinx_exc_role library. ---------------------------------------------------------------------- ## Functions Utility functions parse_int(text: str) -> int Parse a string into an integer. Raises :py:exc:`ValueError` if not numeric. Parameters ---------- text The string to parse. Returns ------- int The parsed integer value. Raises ------ ValueError If the string cannot be parsed as an integer. safe_cast(value: object, target_type: type) -> object Safely cast a value to a target type. May raise :py:exc:`TypeError` or :py:exc:`ValueError`. Parameters ---------- value The value to cast. target_type The type to cast to. Returns ------- object The cast value. Raises ------ TypeError If the value cannot be cast to the target type. ValueError If the value is invalid for the target type.