# 📡 Morsecode Handler
Easily **encode and decode Morse code** in Python 🐍.
This library is simple, lightweight, and includes both a **Python API** and a **Command-Line Interface (CLI)**.
✅ Learn Morse code
✅ Encode secret messages
✅ Use it in scripts, projects, or just for fun
---
## 🚀 Installation
Install from [PyPI](https://pypi.org/project/morsecode/):
```bash
pip install morsecode_handler
````
---
## 🛠️ Usage in Python
```python
import morsecode_handler
# Encode text
encoded = morsecode_handler.encode("HELLO WORLD")
print(encoded)
# .... . .-.. .-.. --- / .-- --- .-. .-.. -..
# Decode Morse back to text
decoded = morsecode_handler.decode(".... . .-.. .-.. --- / .-- --- .-. .-.. -..")
print(decoded)
# HELLO WORLD
```
### Lenient Mode (skip unknown characters)
```python
import morsecode_handler
morsecode_handler.encode("HELLO 🙂", strict=False, unknown="?")
# .... . .-.. .-.. --- / ?
```
---
## 💻 Command Line Tool
Once installed, you also get the `morsecode` CLI:
```bash
# Encode
morsecode_handler encode "HELLO WORLD"
# .... . .-.. .-.. --- / .-- --- .-. .-.. -..
# Decode
morsecode_handler decode ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."
# HELLO WORLD
# Lenient mode (replace unknown characters with '?')
morsecode_handler encode "HELLO 🙂" --lenient
# .... . .-.. .-.. --- / ?
```
---
## 🌍 Supported Languages
This library supports **41 languages** across Latin, Cyrillic, Arabic, Hebrew, Greek, and Korean scripts.
We follow the **ISO 639-1 standard** for the two-letter language codes (e.g., `EN` for English, `FR` for French, `RU` for Russian).
| Code | Language | Code | Language | Code | Language | Code | Language |
|------|--------------|------|-------------|------|-------------|------|------------|
| AF | Afrikaans | AR | Arabic | EU | Basque | CA | Catalan |
| HR | Croatian | CS | Czech | DA | Danish | NL | Dutch |
| EN | English | EO | Esperanto | ET | Estonian | FI | Finnish |
| FR | French | GL | Galician | DE | German | EL | Greek |
| HE | Hebrew | HU | Hungarian | IS | Icelandic | ID | Indonesian |
| GA | Irish | IT | Italian | KO | Korean | LV | Latvian |
| LT | Lithuanian | MS | Malay | NO | Norwegian | PL | Polish |
| PT | Portuguese | RO | Romanian | RU | Russian | SR | Serbian |
| SK | Slovak | SL | Slovenian | ES | Spanish | SV | Swedish |
| TL | Tagalog | TR | Turkish | UK | Ukrainian | VI | Vietnamese |
---
## ⚡ Features
* 🔑 Encode and decode Morse code
* 🎯 Strict mode (raise errors) or Lenient mode (skip unknowns)
* 💻 CLI for quick terminal use
* 🌍 Multi-language support via JSON dictionary
* 📝 MIT licensed — free to use anywhere
---
## 📜 License
Released under the MIT [License](LICENSE).
Created by **Ricardo** ([mricardo888](https://github.com/mricardo888)).
Raw data
{
"_id": null,
"home_page": null,
"name": "morsecode-handler",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "morse, morse code, encode, decode, cli, language, handler",
"author": null,
"author_email": "Ricardo <ricardo.lee.cm@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/85/8b/7c3554cb56c8e0a96b4b299a0fe71254857cc5d22012f9d6f42bb28b21a7/morsecode_handler-0.0.1.tar.gz",
"platform": null,
"description": "# \ud83d\udce1 Morsecode Handler\n\nEasily **encode and decode Morse code** in Python \ud83d\udc0d. \nThis library is simple, lightweight, and includes both a **Python API** and a **Command-Line Interface (CLI)**.\n\n\u2705 Learn Morse code \n\u2705 Encode secret messages \n\u2705 Use it in scripts, projects, or just for fun\n\n---\n\n## \ud83d\ude80 Installation\n\nInstall from [PyPI](https://pypi.org/project/morsecode/):\n\n```bash\npip install morsecode_handler\n````\n\n---\n\n## \ud83d\udee0\ufe0f Usage in Python\n\n```python\nimport morsecode_handler\n\n# Encode text\nencoded = morsecode_handler.encode(\"HELLO WORLD\")\nprint(encoded)\n# .... . .-.. .-.. --- / .-- --- .-. .-.. -..\n\n# Decode Morse back to text\ndecoded = morsecode_handler.decode(\".... . .-.. .-.. --- / .-- --- .-. .-.. -..\")\nprint(decoded)\n# HELLO WORLD\n```\n\n### Lenient Mode (skip unknown characters)\n\n```python\nimport morsecode_handler\n\nmorsecode_handler.encode(\"HELLO \ud83d\ude42\", strict=False, unknown=\"?\")\n# .... . .-.. .-.. --- / ?\n```\n\n---\n\n## \ud83d\udcbb Command Line Tool\n\nOnce installed, you also get the `morsecode` CLI:\n\n```bash\n# Encode\nmorsecode_handler encode \"HELLO WORLD\"\n# .... . .-.. .-.. --- / .-- --- .-. .-.. -..\n\n# Decode\nmorsecode_handler decode \".... . .-.. .-.. --- / .-- --- .-. .-.. -..\"\n# HELLO WORLD\n\n# Lenient mode (replace unknown characters with '?')\nmorsecode_handler encode \"HELLO \ud83d\ude42\" --lenient\n# .... . .-.. .-.. --- / ?\n```\n\n---\n\n## \ud83c\udf0d Supported Languages\n\nThis library supports **41 languages** across Latin, Cyrillic, Arabic, Hebrew, Greek, and Korean scripts. \nWe follow the **ISO 639-1 standard** for the two-letter language codes (e.g., `EN` for English, `FR` for French, `RU` for Russian).\n\n| Code | Language | Code | Language | Code | Language | Code | Language |\n|------|--------------|------|-------------|------|-------------|------|------------|\n| AF | Afrikaans | AR | Arabic | EU | Basque | CA | Catalan |\n| HR | Croatian | CS | Czech | DA | Danish | NL | Dutch |\n| EN | English | EO | Esperanto | ET | Estonian | FI | Finnish |\n| FR | French | GL | Galician | DE | German | EL | Greek |\n| HE | Hebrew | HU | Hungarian | IS | Icelandic | ID | Indonesian |\n| GA | Irish | IT | Italian | KO | Korean | LV | Latvian |\n| LT | Lithuanian | MS | Malay | NO | Norwegian | PL | Polish |\n| PT | Portuguese | RO | Romanian | RU | Russian | SR | Serbian |\n| SK | Slovak | SL | Slovenian | ES | Spanish | SV | Swedish |\n| TL | Tagalog | TR | Turkish | UK | Ukrainian | VI | Vietnamese |\n\n---\n\n## \u26a1 Features\n\n* \ud83d\udd11 Encode and decode Morse code\n* \ud83c\udfaf Strict mode (raise errors) or Lenient mode (skip unknowns)\n* \ud83d\udcbb CLI for quick terminal use\n* \ud83c\udf0d Multi-language support via JSON dictionary\n* \ud83d\udcdd MIT licensed \u2014 free to use anywhere\n\n---\n\n## \ud83d\udcdc License\n\nReleased under the MIT [License](LICENSE).\nCreated by **Ricardo** ([mricardo888](https://github.com/mricardo888)).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Encode and decode Morse code with custom errors, language JSON dictionaries, and CLI support.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/mricardo888/morsecode",
"Issues": "https://github.com/mricardo888/morsecode/issues",
"Repository": "https://github.com/mricardo888/morsecode.git"
},
"split_keywords": [
"morse",
" morse code",
" encode",
" decode",
" cli",
" language",
" handler"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "46500e678d3e89442a4c8b3e15d3e66391cee0963e6727bde87dbc89f7f7a62f",
"md5": "268ee9cee7a1a13d1ff657974ef09414",
"sha256": "77c690be511cea9d202824d48ccdab579dd3158a68388c876a3e0d8c20f3a812"
},
"downloads": -1,
"filename": "morsecode_handler-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "268ee9cee7a1a13d1ff657974ef09414",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8373,
"upload_time": "2025-08-23T12:38:23",
"upload_time_iso_8601": "2025-08-23T12:38:23.020358Z",
"url": "https://files.pythonhosted.org/packages/46/50/0e678d3e89442a4c8b3e15d3e66391cee0963e6727bde87dbc89f7f7a62f/morsecode_handler-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "858b7c3554cb56c8e0a96b4b299a0fe71254857cc5d22012f9d6f42bb28b21a7",
"md5": "67d754c0f42f1de829c76f3e2247e4d0",
"sha256": "4754117b39ea45edbe6300b612cade6bce4f8a68c2e2cefb724aab835a40ea25"
},
"downloads": -1,
"filename": "morsecode_handler-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "67d754c0f42f1de829c76f3e2247e4d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7218,
"upload_time": "2025-08-23T12:38:24",
"upload_time_iso_8601": "2025-08-23T12:38:24.288507Z",
"url": "https://files.pythonhosted.org/packages/85/8b/7c3554cb56c8e0a96b4b299a0fe71254857cc5d22012f9d6f42bb28b21a7/morsecode_handler-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-23 12:38:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mricardo888",
"github_project": "morsecode",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "morsecode-handler"
}