def monthly ( date = datetime . date . today ( ) ) : return datetime . date ( date . year , date . month , 1 )
set date to 1st of the current month python
Take a date object and return the first day of the month .
def monthly(date=datetime.date.today()):
    """
    Take a date object and return the first day of the month.
    """
    return datetime.date(date.year, date.month, 1)