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

Uploaded Source

Built Distribution

Mesh_Client-0.9.4-py2.py3-none-any.whl (29.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: Mesh Client-0.9.4.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for Mesh Client-0.9.4.tar.gz
Algorithm Hash digest
SHA256 985d91f8cb39dcd9d885a1673f1590f98250f3f9bdbabac3d5c8d6ac4cb104a4
MD5 eccbce81008e298b080991f0af9a5795
BLAKE2b-256 d4b467d70a77da4ad0666ab8a38e1c07ace20266d06b432c0e8b679914cecfb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Mesh_Client-0.9.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 29.6 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/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for Mesh_Client-0.9.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f2a69994d2095ea3db7a1629b9ae073108014630edabfbf08527da561e1717d6
MD5 5dd6e86f1484a3fec1c7931c84eb5eed
BLAKE2b-256 f45c2437f1b783b785c6f0a2aac31610deb594d270d25434f7541e264cc00248

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