oSparc file communications
Project description
oSparc File Communications Python Library
This library is meant to perform stable file-based communications between python code that runs in oSparc services.
Installation
pip install osparc-filecomms
Handshake Usage
With a handshake two services can exchange each other's ID, with a guarantee that the service on the other side is alive. The protocol has an 'initiator' and a 'receiver'.
from osparc-filecomms import handshakers
import uuid
# Existing input/output directories
input_dir = Path("input_dir")
output_dir = Path("output_dir")
my_uuid = str(uuid.uuid4())
handshaker = handshakers.FileHandshaker(my_uuid, input_dir, output_dir, is_initiator=True)
other_side_uuid = handshaker.shake()
print(f"I performed a handshake. My uuid is: {my_uuid}. The other side's uuid is: {other_side_uuid}")
After this code has run on both sides, both uuid's can be used in data files that are exchanged. If the processes accessing these files make sure the receiver and sender uuid match, they can be sure the files are coming from another service that is live.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for osparc_filecomms-0.9.25-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c22fe68f70d95ffd22fcb84bec1ceead95b2011c9a46ad62b19cf9bab83d623 |
|
MD5 | d8c8856ae7ec78dc9e0d7ad15bdfb138 |
|
BLAKE2b-256 | b0787bfcd60ab49dfffaae869fa9595b5829165a4d57cfc007fc3177a0d149fc |