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
client = MeshClient(
    'https://msg.dep.spine2.ncrs.nhs.uk',
    'MYMAILBOX',
    'Password123!'
    cert=('/etc/certs/cert.pem', '/etc/certs/key.pem'),  # Mesh uses SSL, so you'll need some certs
    verify='/etc/certs/mesh-ca-cert.pem')

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')

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

Uploaded Source

Built Distribution

Mesh_Client-0.9.2-py2.py3-none-any.whl (29.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: Mesh Client-0.9.2.tar.gz
  • Upload date:
  • Size: 27.1 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.43.0 CPython/3.6.9

File hashes

Hashes for Mesh Client-0.9.2.tar.gz
Algorithm Hash digest
SHA256 1a92316d8f219edae247f07edd590673d99da72f0d4c72ad530343560cee4857
MD5 99165bc1d36742e25bc33371ddc2bd26
BLAKE2b-256 985779a3d10ad20e3b8eecf192ff7299373da5c80237814a4a412951a3ce8c77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Mesh_Client-0.9.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 29.3 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.43.0 CPython/3.6.9

File hashes

Hashes for Mesh_Client-0.9.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7e41bf22b30d93bdcc2b826b64a454e96ec845075479e006ca815f11c6334c3f
MD5 34884f5f7651cdbb5aebcdb3cc5545e9
BLAKE2b-256 12bc0b002a9a2ff47f318143302b26d630dc6201345bd428911a481810108120

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