Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

Metadata

Release files for adapt.py 0.1.0a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adapt.py 0.1.0a0
File Size Uploaded
adapt.py-0.1.0a0.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adapt.py 0.1.0a0
File Interpreter ABI Platform
adapt.py-0.1.0a0-py3-none-any.whl Python 3 none any Details

Total release size: 84.4 kB

Release files / adapt.py-0.1.0a0.tar.gz

Download URL adapt.py-0.1.0a0.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fb75302bfeaa5d82b8bd2d890dfea141978f128e1553c24ce9076baae1f9684b
BLAKE2b-256 checksum
How to use checksums
3de6c233b26afb06ac8924626259a01292475d764923f4a23da447cd594a2ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release files / adapt.py-0.1.0a0-py3-none-any.whl

Download URL adapt.py-0.1.0a0-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71c0e34c6dace4b0b61426324a1ecc7135b62c9387b354b040161f7352f92143
BLAKE2b-256 checksum
How to use checksums
f7ce289f16bfd74bc3e8280859c26697dc26c446833262dc2eaed5a203899b78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.0a0 This release

2 release files

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