aliceio


Namealiceio JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryAsynchronous framework for Alice from Yandex Dialogs
upload_time2024-05-01 14:04:39
maintainerK1rL3s - Kirill Lesovoy
docs_urlNone
authorK1rL3s - Kirill Lesovoy
requires_python>=3.8
licenseMIT License Copyright (c) 2024, K1rL3s - Kirill Lesovoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords alice aliceio api asyncio bot framework wrapper yandex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://github.com/K1rl3s/aliceio">
    <img width="200px" height="200px" alt="aliceio" src="https://raw.githubusercontent.com/K1rL3s/aliceio/master/docs/_static/logo-aliceio-trans-text.png">
  </a>
</p>
<h1 align="center">
  AliceIO
</h1>

<div align="center">

[![License](https://img.shields.io/pypi/l/aliceio.svg?style=flat)](https://github.com/K1rL3s/aliceio/blob/master/LICENSE)
[![Status](https://img.shields.io/pypi/status/aliceio.svg?style=flat)](https://pypi.org/project/aliceio/)
[![PyPI](https://img.shields.io/pypi/v/aliceio?label=pypi&style=flat)](https://pypi.org/project/aliceio/)
[![Downloads](https://img.shields.io/pypi/dm/aliceio.svg?style=flat)](https://pypi.org/project/aliceio/)
[![GitHub Repo stars](https://img.shields.io/github/stars/K1rL3s/aliceio?style=flat)](https://github.com/K1rL3s/aliceio/stargazers)
[![Supported python versions](https://img.shields.io/pypi/pyversions/aliceio.svg?style=flat)](https://pypi.org/project/aliceio/)
[![Tests](https://img.shields.io/github/actions/workflow/status/K1rL3s/aliceio/tests.yml?style=flat)](https://github.com/K1rL3s/aliceio/actions)
[![Coverage](https://codecov.io/gh/K1rL3s/aliceio/graph/badge.svg?style=flat)](https://codecov.io/gh/K1rL3s/aliceio)

</div>
<p align="center">
    <b>
        Асинхронный фреймворк, упрощающий разработку
        <a target="_blank" href="https://dialogs.yandex.ru/store">навыков Алисы</a>
        из
        <a target="_blank" href="https://dialogs.yandex.ru/development">Яндекс.Диалогов</a>
    </b>
</p>
<p align="center">
    Based on <a target="_blank" href="https://github.com/aiogram/aiogram/tree/dev-3.x">aiogram v3</a>
</p>

## Особенности
- Асинхронность ([asyncio docs](https://docs.python.org/3/library/asyncio.html), [PEP 492](http://www.python.org/dev/peps/pep-0492))
- Тайп-хинты ([PEP 484](http://www.python.org/dev/peps/pep-0484), может быть использован с [mypy](http://mypy-lang.org/))
- Поддержка [PyPy](https://www.pypy.org/)
- Роутеры (Blueprints)
- Машина состояний (Finite State Machine)
- Мидлвари (для входящих событий и вызовов API)
- Мощные [магические фильтры](https://github.com/aiogram/magic-filter)
- Реакция на [долгое время работы](https://yandex.ru/dev/dialogs/alice/doc/publish-settings.html#troubleshooting)


### Важно!
Настоятельно рекомендуется иметь опыт работы с [asyncio](https://docs.python.org/3/library/asyncio.html) перед использованием **aliceio**


## Быстрый старт

Как получить `skill_id` и подключить навык к Алисе можно прочитать <a target="_blank" href="https://aliceio.readthedocs.io/ru/latest/tutorial/start/">тут</a>.

```python
from aiohttp import web
from aliceio import Dispatcher, Skill
from aliceio.types import Message
from aliceio.webhook.aiohttp_server import OneSkillRequestHandler, setup_application

dp = Dispatcher()
skill = Skill(skill_id="...")

@dp.message()
async def hello(message: Message) -> str:
    return f"Привет, {message.session.application.application_id}!"

def main() -> None:
    app = web.Application()
    webhook_requests_handler = OneSkillRequestHandler(dispatcher=dp, skill=skill)

    WEB_SERVER_HOST = "127.0.0.1"
    WEB_SERVER_PORT = 80
    WEBHOOK_PATH = "/alice"

    webhook_requests_handler.register(app, path=WEBHOOK_PATH)
    setup_application(app, dp, skill=skill)
    web.run_app(app, host=WEB_SERVER_HOST, port=WEB_SERVER_PORT)

if __name__ == "__main__":
    main()
```

## Документация
- [Туториал](https://aliceio.readthedocs.io/ru/latest/tutorial/start/)
- [Документация](https://aliceio.readthedocs.io/)
- [Примеры](https://github.com/K1rL3s/aliceio/tree/master/examples)


## Связь
Если у вас есть вопросы, вы можете посетить чат сообщества в Telegram
-   🇷🇺 [\@aliceio_chat](https://t.me/aliceio_chat)


## Лицензия
Copyright © 2023-2024 [K1rL3s](https://github.com/K1rL3s) and [ZloyKobra](https://github.com/ZloyKobra) \
Этот проект использует [MIT](https://github.com/K1rL3s/aliceio/blob/master/LICENSE) лицензию

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aliceio",
    "maintainer": "K1rL3s - Kirill Lesovoy",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "alice, aliceio, api, asyncio, bot, framework, wrapper, yandex",
    "author": "K1rL3s - Kirill Lesovoy",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/91/ef/4e7317c31285f47abe14085641e41da71dab9176b9c0a5001c7218cb061f/aliceio-0.0.3.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <a href=\"https://github.com/K1rl3s/aliceio\">\n    <img width=\"200px\" height=\"200px\" alt=\"aliceio\" src=\"https://raw.githubusercontent.com/K1rL3s/aliceio/master/docs/_static/logo-aliceio-trans-text.png\">\n  </a>\n</p>\n<h1 align=\"center\">\n  AliceIO\n</h1>\n\n<div align=\"center\">\n\n[![License](https://img.shields.io/pypi/l/aliceio.svg?style=flat)](https://github.com/K1rL3s/aliceio/blob/master/LICENSE)\n[![Status](https://img.shields.io/pypi/status/aliceio.svg?style=flat)](https://pypi.org/project/aliceio/)\n[![PyPI](https://img.shields.io/pypi/v/aliceio?label=pypi&style=flat)](https://pypi.org/project/aliceio/)\n[![Downloads](https://img.shields.io/pypi/dm/aliceio.svg?style=flat)](https://pypi.org/project/aliceio/)\n[![GitHub Repo stars](https://img.shields.io/github/stars/K1rL3s/aliceio?style=flat)](https://github.com/K1rL3s/aliceio/stargazers)\n[![Supported python versions](https://img.shields.io/pypi/pyversions/aliceio.svg?style=flat)](https://pypi.org/project/aliceio/)\n[![Tests](https://img.shields.io/github/actions/workflow/status/K1rL3s/aliceio/tests.yml?style=flat)](https://github.com/K1rL3s/aliceio/actions)\n[![Coverage](https://codecov.io/gh/K1rL3s/aliceio/graph/badge.svg?style=flat)](https://codecov.io/gh/K1rL3s/aliceio)\n\n</div>\n<p align=\"center\">\n    <b>\n        \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443\n        <a target=\"_blank\" href=\"https://dialogs.yandex.ru/store\">\u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u0410\u043b\u0438\u0441\u044b</a>\n        \u0438\u0437\n        <a target=\"_blank\" href=\"https://dialogs.yandex.ru/development\">\u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432</a>\n    </b>\n</p>\n<p align=\"center\">\n    Based on <a target=\"_blank\" href=\"https://github.com/aiogram/aiogram/tree/dev-3.x\">aiogram v3</a>\n</p>\n\n## \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438\n- \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c ([asyncio docs](https://docs.python.org/3/library/asyncio.html), [PEP 492](http://www.python.org/dev/peps/pep-0492))\n- \u0422\u0430\u0439\u043f-\u0445\u0438\u043d\u0442\u044b ([PEP 484](http://www.python.org/dev/peps/pep-0484), \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0441 [mypy](http://mypy-lang.org/))\n- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 [PyPy](https://www.pypy.org/)\n- \u0420\u043e\u0443\u0442\u0435\u0440\u044b (Blueprints)\n- \u041c\u0430\u0448\u0438\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 (Finite State Machine)\n- \u041c\u0438\u0434\u043b\u0432\u0430\u0440\u0438 (\u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 API)\n- \u041c\u043e\u0449\u043d\u044b\u0435 [\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b](https://github.com/aiogram/magic-filter)\n- \u0420\u0435\u0430\u043a\u0446\u0438\u044f \u043d\u0430 [\u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b](https://yandex.ru/dev/dialogs/alice/doc/publish-settings.html#troubleshooting)\n\n\n### \u0412\u0430\u0436\u043d\u043e!\n\u041d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 [asyncio](https://docs.python.org/3/library/asyncio.html) \u043f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c **aliceio**\n\n\n## \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\n\n\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c `skill_id` \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430\u0432\u044b\u043a \u043a \u0410\u043b\u0438\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a target=\"_blank\" href=\"https://aliceio.readthedocs.io/ru/latest/tutorial/start/\">\u0442\u0443\u0442</a>.\n\n```python\nfrom aiohttp import web\nfrom aliceio import Dispatcher, Skill\nfrom aliceio.types import Message\nfrom aliceio.webhook.aiohttp_server import OneSkillRequestHandler, setup_application\n\ndp = Dispatcher()\nskill = Skill(skill_id=\"...\")\n\n@dp.message()\nasync def hello(message: Message) -> str:\n    return f\"\u041f\u0440\u0438\u0432\u0435\u0442, {message.session.application.application_id}!\"\n\ndef main() -> None:\n    app = web.Application()\n    webhook_requests_handler = OneSkillRequestHandler(dispatcher=dp, skill=skill)\n\n    WEB_SERVER_HOST = \"127.0.0.1\"\n    WEB_SERVER_PORT = 80\n    WEBHOOK_PATH = \"/alice\"\n\n    webhook_requests_handler.register(app, path=WEBHOOK_PATH)\n    setup_application(app, dp, skill=skill)\n    web.run_app(app, host=WEB_SERVER_HOST, port=WEB_SERVER_PORT)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\n- [\u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b](https://aliceio.readthedocs.io/ru/latest/tutorial/start/)\n- [\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f](https://aliceio.readthedocs.io/)\n- [\u041f\u0440\u0438\u043c\u0435\u0440\u044b](https://github.com/K1rL3s/aliceio/tree/master/examples)\n\n\n## \u0421\u0432\u044f\u0437\u044c\n\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u044c \u0447\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0432 Telegram\n-   \ud83c\uddf7\ud83c\uddfa [\\@aliceio_chat](https://t.me/aliceio_chat)\n\n\n## \u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f\nCopyright \u00a9 2023-2024 [K1rL3s](https://github.com/K1rL3s) and [ZloyKobra](https://github.com/ZloyKobra) \\\n\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 [MIT](https://github.com/K1rL3s/aliceio/blob/master/LICENSE) \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024, K1rL3s - Kirill Lesovoy\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "Asynchronous framework for Alice from Yandex Dialogs",
    "version": "0.0.3",
    "project_urls": {
        "Documentation": "https://aliceio.rtfd.io",
        "Repository": "https://github.com/K1rL3s/aliceio"
    },
    "split_keywords": [
        "alice",
        " aliceio",
        " api",
        " asyncio",
        " bot",
        " framework",
        " wrapper",
        " yandex"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ba542f98ec11e8d28f8a749640d9a3c9b502710f74d58716e4f61bb979561bdd",
                "md5": "c8922e762200d60f738ad4cfc1a111a4",
                "sha256": "4cac1da1a88340c416231b917a39e841d305a28425540005660478450bef7cbd"
            },
            "downloads": -1,
            "filename": "aliceio-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c8922e762200d60f738ad4cfc1a111a4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 109900,
            "upload_time": "2024-05-01T14:04:36",
            "upload_time_iso_8601": "2024-05-01T14:04:36.333886Z",
            "url": "https://files.pythonhosted.org/packages/ba/54/2f98ec11e8d28f8a749640d9a3c9b502710f74d58716e4f61bb979561bdd/aliceio-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "91ef4e7317c31285f47abe14085641e41da71dab9176b9c0a5001c7218cb061f",
                "md5": "8894df669a45d4e74d2cc707f6bf4bca",
                "sha256": "e60db2d7217b6024243d91c96602d1903fb694479bbd07831d7546bd757640a4"
            },
            "downloads": -1,
            "filename": "aliceio-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "8894df669a45d4e74d2cc707f6bf4bca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1852826,
            "upload_time": "2024-05-01T14:04:39",
            "upload_time_iso_8601": "2024-05-01T14:04:39.424249Z",
            "url": "https://files.pythonhosted.org/packages/91/ef/4e7317c31285f47abe14085641e41da71dab9176b9c0a5001c7218cb061f/aliceio-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-01 14:04:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "K1rL3s",
    "github_project": "aliceio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aliceio"
}
        
Elapsed time: 0.25155s