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.1.tar.gz (8.4 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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymorsekit-0.2.1.tar.gz
  • Upload date:
  • Size: 8.4 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.1.tar.gz
Algorithm Hash digest
SHA256 9cffc29aa41d81eb610b72fa7983a4d94fa9adf3917c08c9a745d61956b1a7da
MD5 95c9e9e7b0147db23f4cb201a2473a1b
BLAKE2b-256 999c35a6abf7dd2353652a86accc6cbc9149643a084f82506fb35057d7855cd3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymorsekit-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a4e3f44ebae99ab01fd4193dcabbf7416a3693bb381c33d4a4e5628ee8b110e
MD5 61d78759a0f19b5446528ef0dd988aa4
BLAKE2b-256 3ea25b3e0536b4610b49025f290051f85958c76753bf462351d382041a95ecbb

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