ciphers.simple_keyword_cypher ============================= .. py:module:: ciphers.simple_keyword_cypher Functions --------- .. autoapisummary:: ciphers.simple_keyword_cypher.create_cipher_map ciphers.simple_keyword_cypher.decipher ciphers.simple_keyword_cypher.encipher ciphers.simple_keyword_cypher.main ciphers.simple_keyword_cypher.remove_duplicates Module Contents --------------- .. py:function:: create_cipher_map(key: str) -> dict[str, str] Returns a cipher map given a keyword. :param key: keyword to use :return: dictionary cipher map .. py:function:: decipher(message: str, cipher_map: dict[str, str]) -> str Deciphers a message given a cipher map :param message: Message to decipher :param cipher_map: Dictionary mapping to use :return: Deciphered string >>> cipher_map = create_cipher_map('Goodbye!!') >>> decipher(encipher('Hello World!!', cipher_map), cipher_map) 'HELLO WORLD!!' .. py:function:: encipher(message: str, cipher_map: dict[str, str]) -> str Enciphers a message given a cipher map. :param message: Message to encipher :param cipher_map: Cipher map :return: enciphered string >>> encipher('Hello World!!', create_cipher_map('Goodbye!!')) 'CYJJM VMQJB!!' .. py:function:: main() -> None Handles I/O :return: void .. py:function:: remove_duplicates(key: str) -> str Removes duplicate alphabetic characters in a keyword (letter is ignored after its first appearance). :param key: Keyword to use :return: String with duplicates removed >>> remove_duplicates('Hello World!!') 'Helo Wrd'