A lightweight Python toolkit for encoding, decoding, and working with Morse code.
Project description
PyMorseKit
A lightweight Python library for encoding and decoding Morse code — simple API, zero dependencies.
Features
- Encode plain text to Morse code
- Decode Morse code back to text
- Supports letters, numbers, and common punctuation
- Lightweight with no external dependencies
Installation
pip install PyMorseKit
Quick Start
from pymorsekit import encode, decode
# Encode text to Morse code
print(encode("SOS"))
# Output: ... --- ...
# Decode Morse code to text
print(decode("... --- ..."))
# Output: SOS
API Reference
encode(text: str) -> str
Converts a plain-text string into Morse code. Words are separated by / and characters by spaces.
encode("HELLO WORLD")
# .... . .-.. .-.. --- / .-- --- .-. .-.. -..
decode(morse: str) -> str
Converts a Morse code string back into plain text. Expects characters separated by spaces and words separated by /.
decode(".... . .-.. .-.. --- / .-- --- .-. .-.. -..")
# HELLO WORLD
Supported Characters
| Category | Examples |
|---|---|
| Letters | A–Z (case-insensitive) |
| Numbers | 0–9 |
| Punctuation | . , ? ! ' / ( ) & : ; = + - _ " $ @ |
Contributing
Contributions, bug reports, and feature requests are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m "Add your feature" - Push to the branch:
git push origin feature/your-feature - Open a pull request
Please open an issue before submitting large changes.
Author
Developed and maintained by JackMa GitHub: @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.1.0.tar.gz.
File metadata
- Download URL: pymorsekit-0.1.0.tar.gz
- Upload date:
- Size: 7.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 |
f3bafe395c1ec0c6a49ccf731ea61be8d0da20b55e9336b0e7ed4e6899a0dd2d
|
|
| MD5 |
80ec63f1ca08d446196f3d4f0f5fe71f
|
|
| BLAKE2b-256 |
fa6a0ff9f51f0bdd0ac6944cb193131493a55662d51d8879bd8af2ab023033ed
|
File details
Details for the file pymorsekit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pymorsekit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 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 |
45396c8ef5d530e90ac1c897856136b91368c37ff73dcfabc3ef1a847fdca453
|
|
| MD5 |
9df604c3ab1ddfd98a5db0baa2421793
|
|
| BLAKE2b-256 |
72b77a038f67521f1c5cf1504a99e2e0615d7022f61856b66960b302dfafd0d8
|