semwai / morse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Morse code v1.2.0

master Test pipeline

develop Test pipeline

service for converting morse code to text and vice versa

Run tests

pipenv shell
pipenv install 
pytest

Run server:

docker build -t morse . 
docker run -it --rm -p 88:8000 morse

open localhost:88 in your browser or use curl

curl -X 'GET' \
  'http://localhost:88/decode?text=...%20---%20...&lang=en' \
  -H 'accept: application/json'
{
  "data": "SOS"
}
curl -X 'GET' \
  'http://localhost:88/alphabet?lang=ru' \
  -H 'accept: application/json'
{
  "data": {
    "0": "-----",
    "1": ".----",
    "2": "..---",
    "3": "...--",
    "4": "....-",
    "5": ".....",
    "6": "-....",
    "7": "--...",
    "8": "---..",
    "9": "----.",
    "А": ".-",
    "Б": "-...",
    "В": ".--",
    "Г": "--.",
    "Д": "-..",
    "Е": ".",
    "Ж": "...-",
    "З": "--..",
    "И": "..",
    "Й": ".---",
    "К": "-.-",
    "Л": ".-..",
    "М": "--",
    "Н": "-.",
    "О": "---",
    "П": ".--.",
    "Р": ".-.",
    "С": "...",
    "Т": "-",
    "У": "..-",
    "Ф": "..-.",
    "Х": "....",
    "Ц": "-.-.",
    "Ч": "---.",
    "Ш": "----",
    "Щ": "--.-",
    "Ъ": ".--.-.",
    "Ы": "-.--",
    "Ь": "-..-",
    "Э": "...-...",
    "Ю": "..--",
    "Я": ".-.-",
    ", ": "--..--",
    ".": ".-.-.-",
    "?": "..--..",
    "/": "-..-.",
    "-": "-....-",
    "(": "-.--.",
    ")": "-.--.-"
  }
}

open localhost:88/docs in your browser for swagger UI interactive documentation

Changelog 1.1.0 -> 1.2.0

  • add github actions

Changelog 1.0.0 -> 1.1.0

  • add tests
  • fix encode bug

About

License:MIT License


Languages

Language:Python 100.0%