Skip to main content

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


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.11.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

Mesh_Client-0.11.0-py2.py3-none-any.whl (53.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Mesh Client-0.11.0.tar.gz.

File metadata

  • Download URL: Mesh Client-0.11.0.tar.gz
  • Upload date:
  • Size: 52.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for Mesh Client-0.11.0.tar.gz
Algorithm Hash digest
SHA256 b0e8f70a0c27496fba1ed66d09a5a1cab1766e5c963419211248d5cd0b7f1d58
MD5 75a8f168064e94351bb79f01fc7d16e5
BLAKE2b-256 e4d15c5f9a6c6df8f34e90d31d9b0f77c3e9d6a6d5a24c2531f00513a74311c3

See more details on using hashes here.

File details

Details for the file Mesh_Client-0.11.0-py2.py3-none-any.whl.

File metadata

  • Download URL: Mesh_Client-0.11.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for Mesh_Client-0.11.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 930098556a7ada5d0a47b34f196288704826eb9b6c965f7adaf1c6f83dcd8f4a
MD5 97d92f9be89aa55d415c8b9d681b858b
BLAKE2b-256 b2d4943ad8fe34dcc442c75cd2f9ecb500fa321f0176b186f60f25dbb89ef70e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page