Skip to main content

Easily translate text into Morse code

Project description

MorseCodePy 1.0.2

Introduction

MorseCodePy is a module that simplifies the process of translating normal text into Morse code. This versatile module supports various languages, including English, Russian, Spanish, numbers, symbols and other.

Installation

Installing project using pip:

pip install MorseCodePy or pip3 install MorseCodePy

How to use

encode(string, dit, dash) returns string with translated into Morse code. string is your text, that you want to translate. Also, you can customise dit and dash.

codes is a dictionary with letters, numbers & symbols and their Morse code translations. Warning: translations use 1's and 0's.

chart(dit, dash) writes entire dictionary of letters and their Morse codes.

Examples:

import MorseCodePy as mcp

string = "SOS"
encode_string = mcp.encode(string)

print(encoded_string)
# Output: ··· --- ···
import MorseCodePy as mcp

string = "Bye!"
print(mcp.encode(string, dit='0', dash='1'))
# Output: 1000 1011 0 101011
from MorseCodePy import codes

print(codes['a'])
# Output: 01
import MorseCodePy as mcp

mcp.chart()
# Output: a: 01 b: 1110 ...

Contact

GitHub: https://github.com/CrazyFlyKite

Email: karpenkoartem2846@gmail.com

Discord: CrazyFlyKite

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MorseCodePy-1.0.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file MorseCodePy-1.0.2.tar.gz.

File metadata

  • Download URL: MorseCodePy-1.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for MorseCodePy-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8e37a0769bbc605e808a43c15c637ffef761fe78cf030f6a2786a2f9903cf1b1
MD5 307b78f62ff45abc133746d5e1e34773
BLAKE2b-256 46dc2dc0e660db57a3ba7ad75f2692e0b605b8ff64b6b2d1d593aa0a4b1f64c5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page