Skip to main content

Client for NHS England's MESH messaging system

Project description

MESH Client

A Python client for NHS Digital's MESH API.

Release Notes

see CHANGE-LOG for news on major changes

Installation

pip install mesh-client

Example use

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 have a look at this docker-compose.yml for an example of how to run the sandbox

Guidance for contributors

see CONTRIBUTING

Project details


Download files

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

Source Distribution

Mesh-Client-3.0.9.tar.gz (86.6 kB view details)

Uploaded Source

Built Distribution

Mesh_Client-3.0.9-py2.py3-none-any.whl (22.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Mesh-Client-3.0.9.tar.gz.

File metadata

  • Download URL: Mesh-Client-3.0.9.tar.gz
  • Upload date:
  • Size: 86.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for Mesh-Client-3.0.9.tar.gz
Algorithm Hash digest
SHA256 2d4aadc65a9ec2c4932d39783edd42c9fe071d0dd20e543c9b4e60c06246722a
MD5 d377b7bccf8e520250e031d29837190c
BLAKE2b-256 db4a14d82d4615ffbf604227737656386dcb71debaf82e91a2a79b9cca4bb02b

See more details on using hashes here.

File details

Details for the file Mesh_Client-3.0.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Mesh_Client-3.0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c5b425bad0a0ca58e5ad0c0d625e9fddf800dd413730cd1307e3bd9682ca4306
MD5 9d305348bd37d72630f3693a903e1f38
BLAKE2b-256 3628587f54a6c9a967231c665714fb56f0e99a38f54ea4cc1b81933e7667ad50

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page