import ast
import uuid


def get_imports(path: str) -> dict:
    """
    This function parse the module at specified path to look for import statements and return a dictionary
    representing the import statement.

    :param path: path to the Python module
    :return: information related to the import statements
    """
    imports = {}
    with open(path, mode="r") as file_object:
        tree = ast.parse(file_object.read())
    for node in ast.walk(tree):
        if isinstance(node, ast.Import):
            for module in node.names:
                imports[uuid.uuid4().hex] = {"name": module.name, "type": "import", "alias": module.asname}
        elif isinstance(node, ast.ImportFrom):
            for name in node.names:
                imports[uuid.uuid4().hex] = {"module": node.module, "name": name.name, "alias": name.asname,
                                             "type": "from-import", "level": node.level}
    return imports