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
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 -m build
twine upload -r testpypi 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-1.4.0.tar.gz (51.8 kB view details)

Uploaded Source

Built Distribution

Mesh_Client-1.4.0-py2.py3-none-any.whl (51.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: Mesh Client-1.4.0.tar.gz
  • Upload date:
  • Size: 51.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for Mesh Client-1.4.0.tar.gz
Algorithm Hash digest
SHA256 0e3fa776da887af6270728bb218cc7404e2a137848ddc7f492739915f4a49ccc
MD5 a20a8d9f163c4d119cdba680850faa41
BLAKE2b-256 6ad4ff69ba3b05484f6a7c152db5f989376a7164f1bb719f8415928d5d567718

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Mesh_Client-1.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for Mesh_Client-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 07765b14f398147890ecdffb995458f80fda9d011516e0c664d36460e4d2a3fc
MD5 b2a522be66cf6a0f5cc0cfda07e22fcd
BLAKE2b-256 7cc45197bc98261b62e92fbf6f4135ed66aa40b0663b7e3103d3f4e3b9f53920

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