from typing import Optional


def get_charset(content_type: str) -> Optional[str]:
    """
    Gets the charset from a content type header.

    Parameters
    ----------
    content_type: :class:`str`
        The content type header to get the charset from.

    Returns
    -------
    Optional[:class:`str`]
        The charset, or ``None`` if none was found.
    """
    split = content_type.split('; ')
    if len(split) > 1:
        _, charset = split
        return charset.split('=')[1]

    return None