Skip to main content

Client for NHS Digital 's MESH messaging system

Project description

MESH Client

A Python client for NHS Digital's MESH API.


pip install mesh_client

Example use

from mesh_client import MeshClient, NHS_DEP_ENDPOINT
with MeshClient(
          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)

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

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

Guidance for contributors

You should be doing all your development in a virtualenv / venv. You can install everything you need for development with

pip install -r dev-requirements.txt

We use unittest for tests, and you can run the test suite locally with:

python -m unittest discover . '*'

We use tox for testing on multiple versions. To run the tox tests, just run:


For releases, we use twine. The rough release process would be:

tox  # Re-run tests, just to be sure
rm dist/*  # Get rid of previous distribution files
python sdist bdist_wheel
twine upload --repository-url dist/*
# Check artifacts are uploaded correctly, and that entry on PyPI looks correct
twine upload dist/*

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Mesh-Client, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size Mesh_Client-1.2.0-py2.py3-none-any.whl (56.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size Mesh Client-1.2.0.tar.gz (55.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page