from typing import List
from typing import Tuple
from typing import Dict


def extract_nodes(
    package_rows: List[List], node_type="technology", color="red", shape="circle"
) -> List[Tuple[str, Dict]]:
    """Add nodes from a Tabular Data Table

    Arguments
    ---------
    package_rows : list of dict
    node_type : str, default='technology'
    color : str, default='red'
    shape : str, default='circle'

    Returns
    -------
    list of tuple
        A list of nodes with attributes
    """
    nodes = [
        (
            x[0],
            {
                "type": node_type,
                "fillcolor": color,
                "shape": shape,
                "style": "filled",
                "label": x[0],
            },
        )
        for x in package_rows
    ]

    return nodes