import json


def get_PQWER(champion, input_path):
    """
    Consumes a champion name in string form and returns a dictionary containing
    the champion's passive, Q, W, E, and R ability names and descriptions 
    
    Parameters:
    -----------
    champion    string
    
    Example:
    -----------
    get_PQWER("Malphite") -> dictionary
    
    """
    if champion == "Dr. Mundo":
        champion = "DrMundo"

    # Rek'Sai appears to be the exception in naming conventions
    if champion == 'Reksai':
        champion = 'RekSai'
    
    # Read champ-specific json
    with open(f"{input_path}{champion}.json") as f:
      data = json.load(f)
    
    # global champ_info
    champ_info =dict()
    
    # Add passive
    passive_name = data['data'][champion]['passive']['name']
    passive_description = data['data'][champion]['passive']['description']
    combined_passive = passive_name + '\n\n' + passive_description
    champ_info['passive'] = combined_passive
    
    # Add Q
    Q_name = data['data'][champion]['spells'][0]['name']
    Q_description = data['data'][champion]['spells'][0]['description']
    combined_Q = Q_name + '\n\n' + Q_description
    champ_info['Q'] = combined_Q
    
    # Add W
    W_name = data['data'][champion]['spells'][1]['name']
    W_description = data['data'][champion]['spells'][1]['description']
    combined_W = W_name + '\n\n' + W_description
    champ_info['W'] = combined_W
    
    # Add E
    E_name = data['data'][champion]['spells'][2]['name']
    E_description = data['data'][champion]['spells'][2]['description']
    combined_E = E_name + '\n\n' + E_description
    champ_info['E'] = combined_E
    
    # Add R
    R_name = data['data'][champion]['spells'][3]['name']
    R_description = data['data'][champion]['spells'][3]['description']
    combined_R = R_name + '\n\n' + R_description
    champ_info['R'] = combined_R

    return champ_info