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.0.10.tar.gz
(86.4 kB
view details)
Built Distribution
File details
Details for the file Mesh-Client-3.0.10.tar.gz
.
File metadata
- Download URL: Mesh-Client-3.0.10.tar.gz
- Upload date:
- Size: 86.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 439f817a8d20901e117e37f8012bd8231ba461d96f1dd1480f43fa3e43725142 |
|
MD5 | 88a4e7f130df5b3dc15131f809bce85e |
|
BLAKE2b-256 | 325a17d8c5eaa9a6106a7da56499940d55bf4363c9cd7c5b330629ecf649de55 |
File details
Details for the file Mesh_Client-3.0.10-py2.py3-none-any.whl
.
File metadata
- Download URL: Mesh_Client-3.0.10-py2.py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85e89dc2d242796c17cfa3cda47d55acd8a9afeefef5aa34a712828950b31f39 |
|
MD5 | 391e77e9f24725f8e21bfad8b1ce36e5 |
|
BLAKE2b-256 | 6fb30813ca90e37f7c4f5ad4731c2f4dd04337bd5fb66aa7e28c0a07c0e50284 |