Skip to content

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Python Client

A simple client in Python for the service. The Client handles the connection to the service. A Request structure similar to the C++ API is to construct requests to the made to the service. A single execute method is implemented in the Client to send requests to the service and gather the response.

See the integration test suite (e.g. crud) for sample use of the client.

Resource

It is also possible to use the client as an auto-closing resource.

async with Client(host="localhost", port=2000, application="python-test") as client:
    req = count_request(database="test", collection="test")
    resp = await client.execute(req)
    log.info(f"Count response: {bson.json_util.dumps(resp)}")