Skip to main content

ruff status workflow test status workflow build

Downloads Downloads Downloads

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

key features

  1. 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)
  1. Readable route.
@chatbot.add_command("call me {my_name}")
# or 
chatbot.add_command("call me {my_name} and {my_friend}")
# etc
  1. case sensitive and insensitive.

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

  1. public and private command.

command start with "/" and have description is public command, for example:

@chatbot.add_command("/test", description="test command", strict=True)
  1. invoke callback anywhere.
func = chatrouter.util.get_func("group_name", "command_name")

or

chatrouter.invoke("group", "route", *args, **kwargs)
  1. auto generated /start and /help command.

  2. object storage chatrouter.data_user.

  3. support route with regex.

  4. support autoloader chatrouter.autoloader("path").

  5. support Asynchronous.

  6. 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)

Source distribution for chatrouter 1.0.8
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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page