Chatrouter is an enhanced router for chatbots and easily integrates with any bot library.
key features
- turned complexity into simplicity.
from:
if user_session == "A":
...
elif user_session == "B":
...
elif user_session == "C":
...
else:
...
to:
chatbot = chatrouter.group(user_session)
r = chatrouter.run(chatbot, msg)
- Readable route.
@chatbot.add_command("call me {my_name}")
# or
chatbot.add_command("call me {my_name} and {my_friend}")
# etc
- case sensitive and insensitive.
default case is insensitive but you can add strict=True to a route/command to make it case sensitive.
- public and private command.
command start with "/" and have description is public command, for example:
@chatbot.add_command("/test", description="test command", strict=True)
- invoke callback anywhere.
func = chatrouter.util.get_func("group_name", "command_name")
or
chatrouter.invoke("group", "route", *args, **kwargs)
-
auto generated
/startand/helpcommand. -
object storage
chatrouter.data_user. -
support route with regex.
-
support autoloader
chatrouter.autoloader("path"). -
support Asynchronous.
-
typed python.
installation
pip install chatrouter
Usage
for usage, please see examples directory.
Metadata
Release files for chatrouter 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chatrouter-1.0.8.tar.gz | 7.2 kB | Without provenance | Details |
Release files / chatrouter-1.0.8.tar.gz
| Download URL | chatrouter-1.0.8.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7465cb60f9fb176eeaf203164fb601f8bac8dfbffd1878fb2cdffb947e7221c2
|
|
BLAKE2b-256 checksum How to use checksums |
5ed951936c61e50a708c18934f99ea959d42c4683b4e969983819b5ebfb0966f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|
Security for chatrouter 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.