Metadata-Version: 2.1
Name: Mesh-Client
Version: 3.0.11
Summary: Client for NHS England's MESH messaging system
Home-page: https://github.com/NHSDigital/mesh-client
Author: spinecore
License: MIT
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests >=2.26.0
Requires-Dist: urllib3 >=1.25.4

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

A Python client for [NHS Digital'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)

