Direct Connect Client Library for Python
Run tests
docker compose run test
Linting is black/isort/mypy/flake8 and those can be run locally as appropriate.
Usage
Import and create a client.
from direct_connect import nmdc
client = nmdc.NMDC(host="example.com", nick="my_bot", socket_timeout=2.0)
Send a message.
await msg = await client.send_chat("test chat")
Get a message.
await msg = await client.get_message()
Note this is 'blocking' in the sense that messages are not being
retrieved if get_message() is not being awaited. It may make sense to
build a worker pattern in your application with a task continually
checking for messages.
Messages are returned as dictionaries with user and message keys.
>>> msg
{"user": "my_bot", "message": "test chat"}
Release files for direct-connect 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| direct_connect-0.1.2.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| direct_connect-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / direct_connect-0.1.2.tar.gz
| Download URL | direct_connect-0.1.2.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11605a0027b1864b869a0753509a09c842746a51aaf5677dd18a2750cfabffc0
|
|
BLAKE2b-256 checksum How to use checksums |
6a6cb55455d50ebc0b3212912668642fcb21a055ef315cb4aaa167c308cadf69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Release files / direct_connect-0.1.2-py3-none-any.whl
| Download URL | direct_connect-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d4cedf320c808c1139fd461d9c1919079832c907de336f7588084af9b08e38c
|
|
BLAKE2b-256 checksum How to use checksums |
a85fed00a6e9c06a2611aa554846f512d86f4bd9fe5b38842efbe82c7ad215d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|