import configparser


def submit_kaggle(notebook_name, submission_path, message):
    """ Generate submission string that can be used to submit an entry for scoring by 
    kaggle on test data. Use python magic commands to run 
    
    Args:
        notebook_name (str): Name of jupyter notebook for kaggle entry
        submission_path (str): Path to run length encoded csv data
        message (str): an optional message about data used for submission
    
    Returns:
        submit_string (str): correctly formatted string for kaggle submission
    
    """
    config = configparser.ConfigParser()
    config.read("/home/ubuntu/.kaggle-cli/config")
    comp = config.get('user', 'competition')
    uname = config.get('user', 'username')
    password = config.get('user', 'password')
    submit_string = 'kg submit {} -u \"{}\" -p \"{}\" -c \"{}\" -m \"{}: {}\"' \
    .format(submission_path, uname, password, comp, notebook_name, message)
    return submit_string