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 and decoding Morse code — simple API, zero dependencies.

PyPI version Python versions License


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!

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m "Add your feature"
  4. Push to the branch: git push origin feature/your-feature
  5. 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


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

Uploaded Python 3

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

Hashes for pymorsekit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f3bafe395c1ec0c6a49ccf731ea61be8d0da20b55e9336b0e7ed4e6899a0dd2d
MD5 80ec63f1ca08d446196f3d4f0f5fe71f
BLAKE2b-256 fa6a0ff9f51f0bdd0ac6944cb193131493a55662d51d8879bd8af2ab023033ed

See more details on using hashes here.

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

Hashes for pymorsekit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45396c8ef5d530e90ac1c897856136b91368c37ff73dcfabc3ef1a847fdca453
MD5 9df604c3ab1ddfd98a5db0baa2421793
BLAKE2b-256 72b77a038f67521f1c5cf1504a99e2e0615d7022f61856b66960b302dfafd0d8

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