Metadata-Version: 2.1
Name: direct-connect
Version: 0.1.0
Summary: 
License: ISC
Author: macro1
Author-email: macromicah@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

# Direct Connect Client Library for Python

Run tests
```commandline
docker compose run test
```

Linting is black/isort/mypy/flake8 and those can be run locally as appropriate.


## Usage

Import and create a client.
```python
from direct_connect import nmdc

client = nmdc.NMDC(host="example.com", nick="my_bot", socket_timeout=2.0)
```

Send a message.
```python
await msg = await client.send_chat("test chat")
```

Get a message.
```python
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"}
```

