""" YouTube Monthly feed specific util functions. Helper functions specific for the YouTube Monthly ingestion workflow. """ import calendar def get_first_last_day(month_date): """Get the first and last day of a given month and year. Args: month_date (datetime): YYYY-MM-DD datetime object. Return: tuple(datetime, datetime): first day, last day """ first_day = (month_date.replace(day=1)) last_day = (month_date.replace(day=calendar.monthrange( month_date.year, month_date.month)[1])) return first_day, last_day