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
client = MeshClient(
NHS_DEP_ENDPOINT,
'MYMAILBOX',
'Password123!',
cert=('/etc/certs/cert.pem', '/etc/certs/key.pem')) # Mesh uses SSL, so you'll need some certs
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-0.10.2.tar.gz
(51.9 kB
view details)
Built Distribution
File details
Details for the file Mesh Client-0.10.2.tar.gz
.
File metadata
- Download URL: Mesh Client-0.10.2.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63b7b537e5ff9c0690e0c454dceb3eed5760bce6e87c0f1ff3b3c7bfe609d4c |
|
MD5 | 48b4256ec9c68324148f0613f5f1435b |
|
BLAKE2b-256 | 0e44b5d87a2c736165ad2d82467eab148019c417994411b3f5a83ffda6a630c8 |
File details
Details for the file Mesh_Client-0.10.2-py2.py3-none-any.whl
.
File metadata
- Download URL: Mesh_Client-0.10.2-py2.py3-none-any.whl
- Upload date:
- Size: 53.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04611a03ba979e516dd62b1676e3cc64a7d6bd282a3664933787359d88efd62d |
|
MD5 | 2a98fb44bf7733efba49bbe57d311042 |
|
BLAKE2b-256 | d5f5ac301ca5a9da777e88ac4ecd43d9d459625ffe0c371e9a786fb9ce4729ad |