def AddDateInfoKeywords(rawFolder, filename, base, newName, y, m, d, hr, ampm):
    """
    Adds keywords for year, month, and date image was take to jpegs
    Date data acquired from EXIF via exif.py module
    Adds them as a list appendage, as in:
        info.keyword.extend(['y'+y, 'm'+m, 'd'+d, dd])
    --------------------------------------------------------------------------
    Inputs:
    base:        Base directory for photos --> '/Users/chad/Pictures/testing'
    newName :    New filename as result of RenameFile --> 0000_yyyy-mm-dd_hh-mm-ss_00mm.jpg
    y:           Year from DateTimeDigitized Exif tag
    m:           Month from DateTimeDigitized Exif tag
    d:           Day from DateTimeDigitized Exif tag
    --------------------------------------------------------------------------
    """
    try:
        info = IPTCInfo(os.path.join(base, y, m, d, newName))
        # Day of week
        y = int(y)
        m = int(m)
        d = int(d)
        dd = calendar.weekday(y, m, d)
        dict = {0:'Monday',1:'Tuesday',2:'Wednesday',3:'Thursday',4:'Friday',
                5:'Saturday',6:'Sunday'}
        day = dict[dd]
        # Friendly time of day
        tod = TimeOfDay(hr, ampm)
        # Average RGB value of pic
        rgb = 'rgb' + str(GetRgb(rawFolder, filename))
        # Write our keywords to image
        info.keywords.extend(['y' + str(y), 'm' + str(m), 'd' + str(d), day, ampm, tod, rgb])
        info.saveAs(os.path.join(base, str(y), str(m), str(d), newName))
    except:
        tb = sys.exc_info()[2]
        tbinfo = traceback.format_tb(tb)[0]
        pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n    " + \
                str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"

    Adds keywords for year, month, and date image was take to jpegs
    Date data acquired from EXIF via exif.py module
    Adds them as a list appendage, as in:
        info.keyword.extend(['y'+y, 'm'+m, 'd'+d, dd])
    --------------------------------------------------------------------------
    Inputs:
    base:        Base directory for photos --> '/Users/chad/Pictures/testing'
    newName :    New filename as result of RenameFile --> 0000_yyyy-mm-dd_hh-mm-ss_00mm.jpg
    y:           Year from DateTimeDigitized Exif tag
    m:           Month from DateTimeDigitized Exif tag
    d:           Day from DateTimeDigitized Exif tag
    --------------------------------------------------------------------------
    
recipes/Python/500266_Cataloging_adding_IPTC_keywords_digital/recipe-500266.py