from pathlib import Path
import tempfile
import atexit


def get_temporary_file() -> Path:
    """Creates a temporary file withc is automatically deleted when the program exits"""
    tmp_file = Path(tempfile.mkstemp()[1])
    tmp_file.touch()
    atexit.register(lambda: tmp_file.unlink())
    return tmp_file