def METHOD_NAME(path):
    # in case of '/tmp/.ssh/my.key.dat'
    # this returns ('/tmp/.ssh', 'my.key', 'dat')
    directory = os.path.split(path)[0]
    ext = os.path.splitext(path)[1][1:]  # remove '.', e.g., '.dat' -> 'dat'
    filename = os.path.splitext(os.path.split(path)[1])[0]
    return (directory, filename, ext)