Skip to content

The python module which convert plain text to Morse Code and vice-versa.

License

Notifications You must be signed in to change notification settings

gugupy/morsecodetranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Morse Code Translator

dot-dash

codecov

Its converts plain text to morse code and vice versa and follows below rules for the conversion as per the morse-code algorithm,

  1. Single space for same char repeats
  2. Three spaces for different char
  3. Seven spaces to differentiate the word

Installation

Method 1

To install the MorseCodeTranslator just run the command pip install -U morse-transcript

Method 2

  1. Clone the repository git clone https://github.com/gugupy/morsecodetranslator.git
  2. Run the command pip install -e .

Sample code

from morsecodetranslator.morse import MorseCodeTranslator

mct = MorseCodeTranslator()
print(mct.encrypt('MORSE CODE'))
print(mct.decrypt('--   ---   .-.   ...   .       -.-.   ---   -..   .'))

output

--   ---   .-.   ...   .       -.-.   ---   -..   .  
MORSE CODE

CLI for morse code

Usage

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 '--   ---   .-.   ...   .       -.-.   ---   -..   .'

Run Codecov

pytest --cov=tests --cov-report term --cov-report xml:coverage.xml
./codecov -t ${CODECOV_TOKEN}

About

The python module which convert plain text to Morse Code and vice-versa.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages