import pathlib


def setupoutdir(outdir=None):
    """Create directory structure for csvs and logs.

    Args:
        outdir (path like, optional): Path to top level directory. Defaults to None.

    If outdir is None <home>/Documents/TadoLogs/ is used.
    """
    if outdir is None:
        outdir = pathlib.Path.home() / "Documents" / "TadoLogs"
    else:
        outdir = pathlib.Path(outdir)
    outdir.mkdir(exist_ok=True)
    return outdir