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
pip install -r dev-requirements.txt
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 setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ 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.1.1.tar.gz
(55.0 kB
view details)
Built Distribution
File details
Details for the file Mesh Client-1.1.1.tar.gz
.
File metadata
- Download URL: Mesh Client-1.1.1.tar.gz
- Upload date:
- Size: 55.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | beb5edf9863d97dffdac3428c5b70c6d82a88809d2edde4423f552b593c834c3 |
|
MD5 | f4f2954af5990456cb6b0ec7f30f2aa5 |
|
BLAKE2b-256 | 5a4dd73c229a116554109a43582eba84ea2559b13d69f1d2087423ca71c13c10 |
File details
Details for the file Mesh_Client-1.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: Mesh_Client-1.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0ed285614e813e6c636c9ecc699c7764c89ffeb65091b09084314cf4f3290c6 |
|
MD5 | 6f72c64860bb392898ca78e0fa1b7255 |
|
BLAKE2b-256 | b38622d445e4d849fc92435228fc45b758e8bc50e4547fcc29aa0e2b8dca1419 |