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
Release history Release notifications | RSS feed
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.1.1.tar.gz
(88.1 kB
view hashes)
Built Distribution
Close
Hashes for Mesh_Client-3.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9868c0576403cd9e4a4762d2e7bf4dec6cb3ff27b3fe913e7de0d14e014dcdbb |
|
MD5 | e8ca9d74ffda25c2b7291ce0e0765080 |
|
BLAKE2b-256 | 834520c94fd5a1aaf4033cf4b226b28c2c4ab0fc68a6b587c50618522eecfc7d |