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, NHS_DEP_ENDPOINT
with MeshClient(
NHS_DEP_ENDPOINT,
'MYMAILBOX',
'Password123!',
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')
Guidance for contributors
You should be doing all your development in a virtualenv / venv. You can install everything you need for development with
virtualenv .venv
source .venv/bin/activate
pip install -r dev-requirements.txt
pip install -e .
# if using asdf
pip install tox-asdf
We use unittest for tests, and you can run the test suite locally with:
python -m unittest discover . '*_test.py'
We use tox for testing on multiple versions. To run the tox tests, just run:
tox
For releases, we use twine. The rough release process would be:
tox # Re-run tests, just to be sure
git tag $CURRENT_VERSION
rm dist/* # Get rid of previous distribution files
python -m build
twine upload -r testpypi dist/*
# Check artifacts are uploaded correctly, and that entry on PyPI looks correct
twine upload dist/*
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-1.5.0.tar.gz
(52.4 kB
view details)
Built Distribution
File details
Details for the file Mesh Client-1.5.0.tar.gz
.
File metadata
- Download URL: Mesh Client-1.5.0.tar.gz
- Upload date:
- Size: 52.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8256c7789fd0411ba6d1c103fce29af625a00c18080c574f71d5872d9590deb |
|
MD5 | b48997fd2961177811a234f0e7ea0243 |
|
BLAKE2b-256 | 69599187febad8a10c99335c9a398aa374a23a2961fc0487d5938b44adca7afe |
File details
Details for the file Mesh_Client-1.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: Mesh_Client-1.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 51.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 985c6e253dc498aa4425f861109f772cf6e20fb126353a6c7c86ccc3a36bb819 |
|
MD5 | 2352b5cbfd11f7b138d293d34a1c68c3 |
|
BLAKE2b-256 | 86d9749abfd03bd57468ece543e095b0cc9a0620152924becd8fe211536773e0 |