Metadata-Version: 2.4
Name: vkflow
Version: 1.1.0
Summary: Modern async VK bot framework
Project-URL: Homepage, https://github.com/rogue-meow/vkflow
Project-URL: Documentation, https://rogue-meow.github.io/vkflow
Project-URL: VK group, https://vk.ru/vkflow
Author: Rogue
Author-email: Kurbatov Yan <deknowny@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: api,async,bots,quick,vk
Classifier: Environment :: Console
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Russian
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: aiohttp>=3.11.0
Requires-Dist: cachetools>=7.0.0
Requires-Dist: loguru>=0.7.0
Requires-Dist: pygments>=2.17.0
Provides-Extra: autodoc
Requires-Dist: jinja2>=3.1.0; extra == 'autodoc'
Provides-Extra: dev
Requires-Dist: jinja2>=3.1.0; extra == 'dev'
Requires-Dist: mypy>=1.11.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
Requires-Dist: pytest>=9.0.1; extra == 'dev'
Requires-Dist: ruff>=0.14.5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: markdown-include>=0.8.0; extra == 'docs'
Requires-Dist: mike>=2.1.0; extra == 'docs'
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Requires-Dist: mkdocs<2.0,>=1.6.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=1.0.0; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.9.0; extra == 'docs'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
Requires-Dist: uvicorn[standard]>=0.20.0; extra == 'fastapi'
Provides-Extra: json-libs
Requires-Dist: orjson>=3.10.0; extra == 'json-libs'
Requires-Dist: ujson>=5.10.0; extra == 'json-libs'
Provides-Extra: speed
Requires-Dist: aiodns>=3.2.0; extra == 'speed'
Requires-Dist: brotli>=1.1.0; extra == 'speed'
Requires-Dist: orjson>=3.10.0; extra == 'speed'
Provides-Extra: speedup
Requires-Dist: aiodns>=3.2.0; extra == 'speedup'
Requires-Dist: brotli>=1.1.0; extra == 'speedup'
Requires-Dist: orjson>=3.10.0; extra == 'speedup'
Description-Content-Type: text/markdown

<p align="center">
    <img alt="VKFlow" src="https://raw.githubusercontent.com/rogue-meow/vkflow/main/docs/assets/logo-dark.svg" width="120">
</p>

<h1 align="center">VKFlow</h1>

<p align="center">
  <b>Современный асинхронный фреймворк для создания ботов ВКонтакте</b>
</p>

<p align="center">
  <a href="https://pypi.org/project/vkflow"><img src="https://img.shields.io/pypi/v/vkflow?color=blue" alt="PyPI"></a>
  <a href="https://pypi.org/project/vkflow"><img src="https://img.shields.io/pypi/pyversions/vkflow" alt="Python"></a>
  <a href="https://github.com/rogue-meow/vkflow/blob/main/LICENSE"><img src="https://img.shields.io/github/license/rogue-meow/vkflow" alt="License"></a>
  <a href="https://rogue-meow.github.io/vkflow"><img src="https://img.shields.io/badge/docs-mkdocs-blue" alt="Docs"></a>
  <a href="https://vk.com/club236460230"><img src="https://img.shields.io/badge/VK-community-blue?logo=vk" alt="VK"></a>
</p>

---

## Установка

```shell
pip install vkflow
```

С дополнениями для производительности:

```shell
pip install vkflow[speed]
```

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

```python
import vkflow as vf

app = vf.App()

@app.command("ping")
async def ping():
    return "Pong!"

@app.command("дата")
async def reg_date(user: vf.User):
    date = await vf.get_user_registration_date(user.id)
    return f"{user:@[first_name]} зарегистрирован {date:%d.%m.%Y}"

app.run("YOUR_TOKEN")
```

## Возможности

<table>
<tr><td>

**Type hints как аргументы** - параметры команд парсятся из аннотаций типов

</td><td>

**Интерактивный UI** - клавиатуры, карусели, View с callback-кнопками

</td></tr>
<tr><td>

**FSM** - конечные автоматы для многошаговых диалогов

</td><td>

**Cog-система** - группировка команд в модули

</td></tr>
<tr><td>

**Проверки и cooldown** - декораторы для контроля доступа

</td><td>

**Webhook и LongPoll** - оба режима из коробки

</td></tr>
<tr><td colspan="2">

**Система аддонов** - расширение функциональности через плагины

</td></tr>
</table>

<details>
<summary><b>Интерактивные View</b></summary>

```python
class ConfirmView(vf.ui.View):
    def __init__(self):
        super().__init__(timeout = 60, inline = True)
        self.result = None

    @vf.ui.button(label = "Да", color = "positive")
    async def yes(self, interaction: vf.Callback):
        self.result = True
        await interaction.answer("Принято!")
        self.stop()

    @vf.ui.button(label = "Нет", color = "negative")
    async def no(self, interaction: vf.Callback):
        self.result = False
        await interaction.answer("Отменено")
        self.stop()
```

</details>

<details>
<summary><b>Cog-модули</b></summary>

```python
class Admin(vf.Cog):
    @vf.command("бан")
    @vf.check(...)
    async def ban(self, ctx: vf.Context, user: vf.User):
        ...
        await ctx.reply(f"{user:@[first_name]} забанен")
```

</details>

## Требования

- Python 3.11+
- VK API 5.199

## Credits

Based on [vkquick](https://github.com/deknowny/vkquick).

## Лицензия

[MIT](LICENSE)
