from typing import Any
from typing import Optional


def try_int(value: Any) -> Optional[int]:
    """Convert a value to an int, if possible, otherwise ``None``"""
    return int(str(value)) if str(value).isnumeric() else None