Its converts plain text to morse code and vice versa and follows below rules for the conversion as per the morse-code algorithm,
- Single space for same char repeats
- Three spaces for different char
- Seven spaces to differentiate the word
To install the MorseCodeTranslator just run the command pip install -U morse-transcript
- Clone the repository
git clone https://github.com/gugupy/morsecodetranslator.git
- Run the command
pip install -e .
from morsecodetranslator.morse import MorseCodeTranslator
mct = MorseCodeTranslator()
print(mct.encrypt('MORSE CODE'))
print(mct.decrypt('-- --- .-. ... . -.-. --- -.. .'))
-- --- .-. ... . -.-. --- -.. .
MORSE CODE
usage: morse [-h] {encrypt,decrypt} ...
Convert plain text to morse code and vise-versa.
positional arguments:
{encrypt,decrypt} sub-commands
optional arguments:
-h, --help show this help message and exit
Morse Code Converter
morse encrypt --text 'MORSE CODE'
morse decrypt --morse-text '-- --- .-. ... . -.-. --- -.. .'
pytest --cov=tests --cov-report term --cov-report xml:coverage.xml
./codecov -t ${CODECOV_TOKEN}