semvec/pypi-packages huggingface dataset:
Mesh-Client 5.0.1
Client for NHS England's MESH messaging system
License: MIT
Requires Python: <3.15.0,>=3.10

MESH Client
===========

A Python client for [NHS England's MESH API](https://digital.nhs.uk/developer/api-catalogue/message-exchange-for-social-care-and-health-api).

Release Notes
------------
see [CHANGE-LOG](CHANGE-LOG.md) for news on major changes


Installation
------------

```bash
pip install mesh-client
```

Example use
-----------

```python
from mesh_client import MeshClient, INT_ENDPOINT
# or LIVE_ENDPOINT

with MeshClient(
        INT_ENDPOINT,
    'MYMAILBOX',
    'Password',
    cert=('/etc/certs/cert.pem', '/etc/certs/key.pem')  # Mesh uses SSL, so you'll need some certs
) as client:
    client.handshake()  # It will work without this, but Spine will complain
    message_ids = client.list_messages()
    first_message = client.retrieve_message(message_ids[0])
    print('Subject', first_message.subject)
    print('Message', first_message.read())
    first_message.acknowledge()

    # Alternatively, iterate
    for message in client.iterate_all_messages():
        with message:  # With block will handle acknowledgement
            print('Message', message.read())

    client.send_message('RECIPIENT_MAILBOX', b'Hello World!', subject='Important message')
```

Testing your application
------------------------

We recommend using the [mesh sandbox](https://github.com/NHSDigital/mesh-sandbox) 
have a look at this [docker-compose.yml](docker-compose.yml) for an example of how to run the sandbox


Guidance for contributors
-------------------------

see [CONTRIBUTING](CONTRIBUTING.md)