Skip to main content

Async Python client library for the Chatto webchat Connect API

Project description

chattolib

Unofficial async Python client library for the Chatto webchat API.

Chattolib versions track the Chatto server version they target. 0.4.2 targets Chatto 0.4.2's ConnectRPC API. The upstream server dropped GraphQL in favour of a protobuf-first Connect API (see ADR-042 in chattocorp/chatto), and this release is a full rewrite for that transport. The library speaks Connect JSON over HTTP; realtime WebSocket support is a follow-up.

Install

pip install chattolib

Quick start

import asyncio
from chattolib import ChattoClient

async def main():
    # Public discovery — no auth required
    async with ChattoClient() as anon:
        profile, login = await anon.get_server()
        print(f"Chatto {profile.version}: {profile.name}")

    # Authenticated calls
    async with await ChattoClient.login("username", "password") as client:
        me = await client.me()
        print(f"Logged in as {me.display_name}")

        for entry in await client.list_rooms():
            if entry.room:
                print(f"  - {entry.room.name}")

asyncio.run(main())

Escape hatch

ChattoClient.call(service, method, request) invokes any Connect RPC by full service name, e.g. await client.call("chatto.api.v1.MessageService", "GetMessage", {"roomId": ..., "eventId": ...}).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chattolib-0.4.2.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chattolib-0.4.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file chattolib-0.4.2.tar.gz.

File metadata

  • Download URL: chattolib-0.4.2.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for chattolib-0.4.2.tar.gz
Algorithm Hash digest
SHA256 39b9996560caf8b68ed394ce7ae386fd8f6ea23b225fcc418483962259ff10da
MD5 3b69a4e9276f477405d43ad7a6287ba6
BLAKE2b-256 44e344de542286f73e9b38de334c44aa3c45b8fbe44a8bf3a44a1211cb61847d

See more details on using hashes here.

File details

Details for the file chattolib-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: chattolib-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for chattolib-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bbc491f6914f61d0a56b4c628c1c51a747248fedbe5bba4d5f350dd0d9ccca9d
MD5 cdc296cd1d9a7a7a682afb4f068b7425
BLAKE2b-256 dc12f5c4160ee4af20e780ec73ffd0eac88327018c81f70cbf96cf8559e5dfcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page