"""Utility functions for input-output."""


def read_txt(path: str) -> str:
    """Read the contents of a text file.

    Args:
    ----
        path (str): Path to the file.

    Returns:
    -------
        str: Contents of the file.

    """
    with open(path, "r") as f:
        return f.read()


def write_txt(path: str, contents: str) -> None:
    """Write contents to a text file.

    Args:
    ----
        path (str): Path to the file.
        contents (str): Contents to write.

    """
    with open(path, "w", encoding="utf-8") as f:
        f.write(contents)
