Name | aliceio JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | Asynchronous framework for Alice from Yandex Dialogs |
upload_time | 2024-11-11 22:59:21 |
maintainer | K1rL3s - Kirill Lesovoy |
docs_url | None |
author | K1rL3s - Kirill Lesovoy |
requires_python | >=3.9 |
license | MIT 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
dialogs
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)
- Поддержка [облачных функций Яндекса](https://yandex.cloud/ru/services/functions)
### Важно!
Рекомендуется иметь опыт работы с [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>.
### [Yandex Cloud Functions](https://yandex.ru/dev/dialogs/alice/doc/ru/quickstart-programming):
```python
from aliceio import Dispatcher, Skill
from aliceio.types import Message
from aliceio.webhook.yandex_functions import OneSkillYandexFunctionsRequestHandler
dp = Dispatcher()
skill = Skill(skill_id="...")
requests_handler = OneSkillYandexFunctionsRequestHandler(dispatcher=dp, skill=skill)
@dp.message()
async def hello(message: Message) -> str:
return f"Привет, {message.session.application.application_id}!"
async def main(event, context):
return await requests_handler(event, context)
```
### Вебхук:
```python
from aiohttp import web
from aliceio import Dispatcher, Skill
from aliceio.types import Message
from aliceio.webhook.aiohttp_server import OneSkillAiohttpRequestHandler, 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()
requests_handler = OneSkillAiohttpRequestHandler(dispatcher=dp, skill=skill)
WEB_SERVER_HOST = "127.0.0.1"
WEB_SERVER_PORT = 80
WEBHOOK_PATH = "/alice"
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)
## Связь
Если у вас есть вопросы, вы можете задать их в Телеграм чате
- 🇷🇺 [\@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.9",
"maintainer_email": null,
"keywords": "alice, aliceio, api, asyncio, bot, dialogs, framework, wrapper, yandex",
"author": "K1rL3s - Kirill Lesovoy",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/c6/b0/9dbe3fff80eb99526c8b3fa12e3e5b9aaf9e2dc10dca563393f5a145220b/aliceio-0.2.0.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 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\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- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 [\u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u042f\u043d\u0434\u0435\u043a\u0441\u0430](https://yandex.cloud/ru/services/functions)\n\n\n### \u0412\u0430\u0436\u043d\u043e!\n\u0420\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### [Yandex Cloud Functions](https://yandex.ru/dev/dialogs/alice/doc/ru/quickstart-programming):\n```python\nfrom aliceio import Dispatcher, Skill\nfrom aliceio.types import Message\nfrom aliceio.webhook.yandex_functions import OneSkillYandexFunctionsRequestHandler\n\ndp = Dispatcher()\nskill = Skill(skill_id=\"...\")\nrequests_handler = OneSkillYandexFunctionsRequestHandler(dispatcher=dp, skill=skill)\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\nasync def main(event, context):\n return await requests_handler(event, context)\n```\n\n### \u0412\u0435\u0431\u0445\u0443\u043a:\n```python\nfrom aiohttp import web\nfrom aliceio import Dispatcher, Skill\nfrom aliceio.types import Message\nfrom aliceio.webhook.aiohttp_server import OneSkillAiohttpRequestHandler, 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 requests_handler = OneSkillAiohttpRequestHandler(dispatcher=dp, skill=skill)\n\n WEB_SERVER_HOST = \"127.0.0.1\"\n WEB_SERVER_PORT = 80\n WEBHOOK_PATH = \"/alice\"\n\n 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\n## \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b\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 \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u0445 \u0432 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0447\u0430\u0442\u0435\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.2.0",
"project_urls": {
"Documentation": "https://aliceio.rtfd.io",
"Repository": "https://github.com/K1rL3s/aliceio"
},
"split_keywords": [
"alice",
" aliceio",
" api",
" asyncio",
" bot",
" dialogs",
" framework",
" wrapper",
" yandex"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1fc4982d4bd36b768183befa39771ac183ead98840597dd4a77eea42f98e04ad",
"md5": "c64f1684e4fae0c1fcbe458ac286d5ad",
"sha256": "45b8eea95bab9c3db0b8a47bd026058b75dd7d62d9efcdb13a5a5eff2bd81d6a"
},
"downloads": -1,
"filename": "aliceio-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c64f1684e4fae0c1fcbe458ac286d5ad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 115669,
"upload_time": "2024-11-11T22:59:18",
"upload_time_iso_8601": "2024-11-11T22:59:18.370006Z",
"url": "https://files.pythonhosted.org/packages/1f/c4/982d4bd36b768183befa39771ac183ead98840597dd4a77eea42f98e04ad/aliceio-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c6b09dbe3fff80eb99526c8b3fa12e3e5b9aaf9e2dc10dca563393f5a145220b",
"md5": "df0e1b123a407c555d20e31079d07014",
"sha256": "c7ddb5098fb9ab4cc9c12de8638be4856245097488607c8daec1b4f64a235b9e"
},
"downloads": -1,
"filename": "aliceio-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "df0e1b123a407c555d20e31079d07014",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2115278,
"upload_time": "2024-11-11T22:59:21",
"upload_time_iso_8601": "2024-11-11T22:59:21.169604Z",
"url": "https://files.pythonhosted.org/packages/c6/b0/9dbe3fff80eb99526c8b3fa12e3e5b9aaf9e2dc10dca563393f5a145220b/aliceio-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-11 22:59:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "K1rL3s",
"github_project": "aliceio",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aliceio"
}