Skip to main content

A lightweight Python toolkit for encoding, decoding, and working with Morse code.

Project description

PyMorseKit

A lightweight Python library for encoding, decoding, and exporting Morse code as audio.

PyPI version Python versions License


Features

  • Encode plain text to Morse code
  • Decode Morse code back to text
  • Export Morse code as WAV audio files
  • Supports letters, numbers, and common punctuation
  • Lightweight with no external dependencies

Installation

pip install PyMorseKit

Quick Start

from pymorsekit import encode, decode

print(encode("SOS"))
# ... --- ...

print(decode("... --- ..."))
# SOS

Audio Export

Generate Morse code audio and save it as a WAV file.

from pymorsekit import save_audio

save_audio(
    text="SOS",
    output="sos.wav"
)

This creates a WAV file containing the Morse code audio for the provided text.


API Reference

encode(text: str) -> str

Convert plain text into Morse code.

encode("HELLO WORLD")
# .... . .-.. .-.. --- / .-- --- .-. .-.. -..

decode(morse: str) -> str

Convert Morse code back into plain text.

decode(".... . .-.. .-.. --- / .-- --- .-. .-.. -..")
# HELLO WORLD

save_audio(text: str, output: str) -> str

Generate Morse code audio and save it as a WAV file.

save_audio("HELLO", "hello.wav")

Supported Characters

Category Examples
Letters A-Z
Numbers 0-9
Punctuation . , ? ! / ( ) : ; = + - _ " $ @

Contributing

Contributions, bug reports, and feature requests are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push your branch
  5. Open a pull request

Author

Developed and maintained by JackMa

GitHub: https://github.com/Fmasterpro27


License

This project is licensed under the Apache License 2.0.

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

pymorsekit-0.2.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymorsekit-0.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pymorsekit-0.2.0.tar.gz.

File metadata

  • Download URL: pymorsekit-0.2.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for pymorsekit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a2974c1681c4ffb99f1472a6d246e6c69addabe373d07f20e698f20e87152b8a
MD5 0990c1a416e4bc31c8cb94159a5d0b74
BLAKE2b-256 3581fc6399c199b0f1d120cb7b9e917b5c34317a49eda9a453e106f88bf574eb

See more details on using hashes here.

File details

Details for the file pymorsekit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pymorsekit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for pymorsekit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 655c9dc9eecc32189a27bbfa335f088f25008050246c4f2953a297e0da8b2c2d
MD5 85cf049a5412d4f1474bbe53faf8adfe
BLAKE2b-256 7bf7a2037105e1d9eef17b68b3d201ac17af886c1ee5f1be0440ca28892033ae

See more details on using hashes here.

Supported by

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