Client for NHS Digital 's MESH messaging system
Project description
MESH Client
A Python client for NHS Digital's MESH API.
Installation
pip install mesh_client
Example use
from mesh_client import MeshClient
client = MeshClient(
'https://msg.dep.spine2.ncrs.nhs.uk',
'MYMAILBOX',
'Password123!'
cert=('/etc/certs/cert.pem', '/etc/certs/key.pem'), # Mesh uses SSL, so you'll need some certs
verify='/etc/certs/mesh-ca-cert.pem')
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')
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-0.9.3.tar.gz
(27.4 kB
view hashes)
Built Distribution
Close
Hashes for Mesh_Client-0.9.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3568022738e4e081976fef42b758932c9c7a24d9e837f0c572a93bfbc52bfa98 |
|
MD5 | 51743c1670012626c096db2a96be6a54 |
|
BLAKE2b-256 | b199e6ab3b35adf02e2aa6efd69c9c419540f4fecd166a48e6f0e8f9fd049223 |