Metadata-Version: 2.1
Name: chatrouter
Version: 1.0.7
Summary: Typed router for chatbot
Home-page: https://github.com/cirebon-dev/chatrouter
Author: guangrei
Author-email: myawn@pm.me
License: MIT
Platform: any
Description-Content-Type: text/markdown
Requires-Dist: aiofiles
Requires-Dist: typing-extensions
Requires-Dist: types-aiofiles

Chatrouter is an enhanced router for chatbots and easily integrates with any bot library.

## key features

1. turned complexity into simplicity.

from:
```python
if user_session == "A":
    ...
elif user_session == "B":
    ...
elif user_session == "C":
    ...
else:
    ...
```
to:
```python
chatbot = chatrouter.group(user_session)
r = chatrouter.run(chatbot, msg)
```
2. Readable route.

```python
@chatbot.add_command("call me {my_name}")
# or 
chatbot.add_command("call me {my_name} and {my_friend}")
# etc
```

3. case sensitive and insensitive.

default case is `insensitive` but you can add `strict=True` to a route/command to make it case  sensitive.

4. public and private command.

command start with "/" and have description is public command, for example:
```python
@chatbot.add_command("/test", description="test command", strict=True)
```
5. invoke callback anywhere.

```python
func = chatrouter.util.get_func("group_name", "command_name")
```

or

```python
chatrouter.invoke("group", "route", *args, **kwargs)
```

6. auto generated `/start` and `/help` command.

7. object storage `chatrouter.data_user`.

8. support route with regex.

9. support autoloader `chatrouter.autoloader("path")`.

10. support Asynchronous.

11. typed python.

## installation

```
pip install chatrouter
```

## Usage

for usage, please see [examples](https://github.com/cirebon-dev/chatrouter/tree/main/examples) directory.
