Skip to main content

Client for NHS England's MESH messaging system

Project description

MESH Client

A Python client for NHS England'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-5.0.1.tar.gz (93.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mesh_client-5.0.1-py2.py3-none-any.whl (31.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mesh_client-5.0.1.tar.gz.

File metadata

  • Download URL: mesh_client-5.0.1.tar.gz
  • Upload date:
  • Size: 93.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mesh_client-5.0.1.tar.gz
Algorithm Hash digest
SHA256 6565cb1a2f6e728ebc0a5274a7543a8a7f554a41c2f74db84e4a4f514ec86d35
MD5 02f289ab83a990d7b5e7eb521f9559ad
BLAKE2b-256 147045ac84638cd3040ccf536b95fa4724459a28b071a1f88bf7413790daa2c2

See more details on using hashes here.

File details

Details for the file mesh_client-5.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: mesh_client-5.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mesh_client-5.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 34210abba5556aeedbbf8921e16b0e27067efd8230a026f350c9f22491637db8
MD5 cb3267d611ca0185fabf727c207012df
BLAKE2b-256 8930565d27d7483effbad6ebe36821723177c9fe63ed9c0ab5a6ee782228de5b

See more details on using hashes here.

Supported by

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