from datetime import datetime


def ts_dict(timestamp=None):
    """
    timestamp <datetime obj> defaults to utc now

    returns a timestamp dict with keys:
        * year YYYY
        * month MM
        * day DD
        * hour HH
        * min MM
        * sec SS
    """

    if not timestamp:
        timestamp = datetime.utcnow()

    timestamp_dict = {
        "year": timestamp.strftime("%Y"),
        "month": timestamp.strftime("%m"),
        "day": timestamp.strftime("%d"),
        "hour": timestamp.strftime("%H"),
        "min": timestamp.strftime("%M"),
        "sec": timestamp.strftime("%S"),
    }

    return timestamp_dict