Welcome to Morse Talk’s documentation!

Release:0.1.1
Date:December 25, 2016

Contents:

Overview

Morse Talk is a Python language software package written for interpretation of Morse Code and utilizing it in all possible way. Currently it focuses in encoding and decoding and generating sounds for the codes.

Goals

NetworkX is intended to provide

  • Encoding and decoding Morse Code in default and binary encription,
  • More types of Encription,
  • Converting Morse Codes into sound signals,
  • Generating wave forms for the encoded signals.

The Python programming language

Python is a powerful programming language that allows simple and flexible ways to deal with patterns and dictionaries. Python has a vibrant and growing ecosystem of packages that Morse Talk can use to provide more features.

Most importantly, Python is free, well-supported, and a joy to use.

Free software

Morse Talk is free software; you can redistribute it and/or modify it under the terms of the MIT Licence. You are most welcomed to contribute to it over the developing zone https://github.com/orkohunter/morse-talk

History

Morse Talk was created by Himanshu Mishra <https://github.com/orkohunter> in May 2015 as a fun project to work on.

Download

Software

Source and binary releases: https://pypi.python.org/pypi/morse-talk/

Github (latest development): https://github.com/orkohunter/morse-talk

Installing

Before installing Morse Talk, you need to have setuptools installed.

Quick install

Get Morse Talk from the Python Package Index at http://pypi.python.org/pypi/morse-talk

or install it with pip

pip install morse-talk

You can install the development version (at github.com) with

git clone https://github.com/orkohunter/morse-talk
cd morse-talk/
python setup.py install

Requirements

Python

To use Morse Talk you need Python 2.7, 3.2 or later.

Optional packages

Currently Morse Talk does not use any other optional package.

Tutorial

Start here to begin working with Morse Talk.

Encode a message

Create a message you want to encode.

>>> import morse_talk as mtalk
>>> message = "Hi, I'll be there by 10 PM"

message is a Python string. No leading or trailing whitespaces are allowed in it. Even if it is there, it will be truncated off for encoding.

Now encode your message in Morse Code.

>>> code = mtalk.encode(message)
>>> code
'....   ..   --..--       ..   .----.   .-..   .-..       -...   .       -   ....   .   .-.   .       -...   -.--       .----   -----       .--.   --'

Note

Morse Talk supports alphabets, numerals and some special characters only. If any unsupported character is present in the message, it will be ignored.

>>> message = "Congratualtion!"
>>> mtalk.encode(message)
WARNING: Unsupported characters in the string
'-.-.   ---   -.   --.   .-.   .-   -   ..-   .-..   .-   -   ..   ---   -.   ...'

You can also encode the message in binary encoding style.

>>> mtalk.encode(code, 'binary')

Decode a message

Decode the message which you have encoded in Morse Code.

>>> code = '.-   .-..   .--.   ....   .-       ....-   .....       -..   .   .--.   .-   .-.   -   .   -..'
>>> message = mtalk.decode(code)
>>> message
'alpha 45 departed'

Decoding a binary message is brainstorming right now. If we think further, there can be multiple messages for a single code. So currently, Morse Talk does not support binary decoding.

>>> code = '11100011111111100011111000111110001111111111'
>>> mtalk.decode(code, 'binary')
Sorry, but it seems that binary encodings can have multiple messages. So for now, we couldn't show even one of them.

By the way, that code was generated by mtalk.encode('sorry', 'binary') ;-)

What Next

Now that you have an idea of what the Morse Talk package provides, you should investigate the parts of the package most useful for you.

Testing

Requirements for testing

Morse Talk uses the Python nose testing package. If you don’t already have that package installed, follow the directions here http://somethingaboutorange.com/mrl/projects/nose

Testing a source distribution

You can test the complete package from the unpacked source directory with:

python setup_egg.py nosetests

Testing an installed package

If you have a file-based (not a Python egg) installation you can test the installed package with

>>> import morse_talk
>>> morse_talk.test()

or:

python -c "import morse_talk; morse_talk.test()"

Testing for developers

You can test any or all of Morse Talk by using the “nosetests” test runner.

First make sure the Morse Talk version you want to test is in your PYTHONPATH (either installed or pointing to your unpacked source directory).

Then you can run individual test files with:

nosetests path/to/file

or all tests found in dir and an directories contained in dir:

nosetests path/to/dir

Indices and tables