from datetime import datetime
from typing import List


def parse_text(now: datetime, key: str, group: List[str]) -> str:
    """
    Handles the Text presentation
    https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html#text
    """
    # Era designator
    if key == "G":
        # no length implications
        return "AD"

    # Day in week
    if key == "E":
        # full form
        if len(group) >= 4:
            return now.strftime("%A")

        # abbreviated form
        return now.strftime("%a")

    # Am/pm marker
    if key == "a":
        # no length implications
        return now.strftime("%p")

    raise Exception(f"Unknown character {key} for parse_text")