MCPcopy Index your code
hub / github.com/ekonda/kutana

github.com/ekonda/kutana @v6.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v6.0.1 ↗ · + Follow
308 symbols 1,136 edges 52 files 36 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Kutana

Kutana logo

PyPI version

The library for developing systems for messengers and social networks. Great for developing bots. Refer to example for the showcase of the library abilities.

This library uses generalized attachment types, possible actions e.t.c. for flexibility to use plugins with different backends.

Installation

python -m pip install kutana

Documentation

You can read the extended description of the library in the docs/index.md file. At the moment, the documentation is not in the best condition. If you would like to contribute to its writing, welcome to the issues.

Running

From CLI

Following command will populate application's config, add specified backends and load plugins from specified folder.

python3 -m kutana run example/config.yml

# usage: kutana [-h] {init,run} ...
#
# helpfull cli utility
#
# positional arguments:
#   {init,run}
#     init      initiate kutana project
#     run       run kutana project using provided config (working directory will be changed to the one with config file)
#
# optional arguments:
#   -h, --help  show this help message and exit

Refer to the example config.yml for the configuration details.

From code

from kutana import Kutana
from kutana.backends import VkontakteLongpoll
from kutana.loaders import load_plugins_from_path

# Create application
app = Kutana()

# Add manager to application
app.add_backend(VkontakteLongpoll(token="VK-GROUP-TOKEN"))

# Load and register plugins
for plugin in load_plugins_from_path("example/plugins/"):
    app.add_plugin(plugin)

if __name__ == "__main__":
    # Run application
    app.run()

Example plugin (plugins/echo.py)

from kutana import Plugin

plugin = Plugin(name="Echo")

@plugin.on_commands(["echo"])
async def _(msg, ctx):
    await ctx.reply(ctx.body, attachments=msg.attachments)

If your function exists only to be decorated, you can use _ to avoid unnecessary names.

Available backends

Core symbols most depended-on inside this repo

reply
called by 37
kutana/context.py
get
called by 27
kutana/storages/memory.py
get
called by 24
kutana/storage.py
add_plugin
called by 11
kutana/kutana.py
make_hash
called by 10
kutana/helpers.py
_direct_request
called by 10
kutana/backends/vkontakte/base.py
handle_updates
called by 8
kutana/backends/debug.py
pick
called by 7
kutana/helpers.py

Shape

Method 176
Function 95
Class 36
Route 1

Languages

Python100%

Modules by API surface

kutana/router.py23 symbols
kutana/backends/vkontakte/base.py19 symbols
kutana/plugin.py18 symbols
kutana/backends/vkontakte/extensions.py18 symbols
kutana/kutana.py17 symbols
kutana/backends/telegram.py14 symbols
kutana/storage.py13 symbols
example/plugins/flipping.py12 symbols
kutana/decorators.py10 symbols
kutana/context.py10 symbols
kutana/backends/debug.py10 symbols
tests/test_plugins.py9 symbols

For agents

$ claude mcp add kutana \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page