from typing import Dict


def _get_site_attributes(site: str, inlet: str, crds_metadata: Dict) -> Dict:
    """Gets the site specific attributes for writing to Datsets

    Args:
        site: Site name
        inlet: Inlet height, example: 108m
        crds_metadata: General CRDS metadata
    Returns:
        dict: Dictionary of attributes
    """
    try:
        site_attributes: Dict = crds_metadata[site.upper()]
        global_attributes: Dict = site_attributes["global_attributes"]
    except KeyError:
        raise ValueError(f"Unable to read attributes for site: {site}")

    attributes = global_attributes

    attributes["inlet_height_magl"] = inlet
    attributes["comment"] = crds_metadata["comment"]
    attributes["long_name"] = site_attributes["gcwerks_site_name"]

    return attributes