import pathlib


def get_package_dir() -> pathlib.Path:
    """Gets the directory for the autotransform package

    Returns:
        pathlib.Path: The package's directory.
    """

    path = pathlib.Path(__file__)
    for parent in path.parents:
        if (parent / "examples").exists() or (parent / "autotransform-examples").exists():
            return parent
    while path.name != "autotransform":
        path = path.parent
    return path.parent