import json import os import uuid from datetime import datetime, timedelta from constants import Constants from logging import logger def get_ordinal(n): if 10 <= n % 100 <= 20: suffix = 'th' else: suffix = {1: 'st', 2: 'nd', 3: 'rd'}.get(n % 10, 'th') return str(n) + suffix def get_today(): now = datetime.now() return now.strftime("%a, %b %d, %Y") def get_sunday(): now = datetime.now() sunday = now - timedelta(days=now.weekday()) - timedelta(days=1) return sunday.strftime("%a, %b %d, %Y") def generate_uuid(): return str(uuid.uuid4())