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.
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.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push your branch
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cffc29aa41d81eb610b72fa7983a4d94fa9adf3917c08c9a745d61956b1a7da
|
|
| MD5 |
95c9e9e7b0147db23f4cb201a2473a1b
|
|
| BLAKE2b-256 |
999c35a6abf7dd2353652a86accc6cbc9149643a084f82506fb35057d7855cd3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a4e3f44ebae99ab01fd4193dcabbf7416a3693bb381c33d4a4e5628ee8b110e
|
|
| MD5 |
61d78759a0f19b5446528ef0dd988aa4
|
|
| BLAKE2b-256 |
3ea25b3e0536b4610b49025f290051f85958c76753bf462351d382041a95ecbb
|