Catalog PyPI
PACKAGE EXPLORERView in registry

adapt.py

PyPI

Official wrapper around Adapt's API for Python.

Versions collected1
Direct dependencies4From release 0.1.0a0
Last observed20 Oct, 19:08 UTC

README

Version 0.1.0a0 documentation

adapt.py

Official wrapper around Adapt's API for Python.

Installation

pip install adapt.py

From GitHub:

pip install git+https://github.com/AdaptChat/adapt.py

Usage

import adapt

class Client(adapt.Client):
    """My example client"""

    @adapt.once  # This event will only be called once
    async def on_ready(self, ready: adapt.ReadyEvent) -> None:
        print(f"Logged in as {ready.user}!")

    async def on_message(self, message: adapt.Message) -> None:
        if message.content == "!ping":
            await message.channel.send("Pong!")

if __name__ == "__main__":
    client = Client()
    client.run("token")

Using adapt.py with a custom Adapt instance

Adapt.py defaults to use the official Adapt instance at https://adapt.chat. If you want to use a custom instance, pass an AdaptServer instance to the server kwarg when constructing the client.

AdaptServer.local() can be used as a shortcut to create a server instance for a local instance of Adapt:

from adapt import AdaptServer, Client

client = Client(server=AdaptServer.local())  # Use a local instance of Adapt
...

Or, you can manually pass in URLs:

from adapt import AdaptServer, Client

server = AdaptServer(
    api="https://my-adapt-instance.com/api",
    harmony="https://my-adapt-instance.com/harmony",
    convey="https://my-adapt-instance.com/convey",
)
client = Client(server=server)
...

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.0a012 Apr 20234

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
adaptchat/adapt.py

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:df4bb7aa922b845be58e03188939aa37fa37ebbe7ea93f21bd8fc77d38e8b0f5