def get_postgres_encoding(python_encoding: str) -> str:
    """Python to postgres encoding map."""

    encoding = normalize_encoding(python_encoding.lower())
    encoding_ = aliases.aliases[encoding.replace('_', '', 1)].upper()
    pg_encoding = PG_ENCODING_MAP[encoding_.replace('_', '')]

    return pg_encoding
Python to postgres encoding map.