Simple python 2/3 library for transporting data to a remote machine, applying transformations and returning a response.
Project description
SimpleDataTransport
Simple python 3 library for transporting data to a remote machine, applying transformations and returning a response. Formerly SimpleImageTransport.
Usage
Start a server on the remote machine:
from SimpleDataTransport import DataReceiver
# Callback takes a single dict with an image and returns a dict of useful data
def example_callback(data):
img = data["image"]
return {'message': 'image received. size={}x{}'.format(img.shape[1], img.shape[0])}
# Initialize the Flask application
flask_receiver = DataReceiver()
flask_receiver.set_callback(example_callback)
flask_receiver.run()
On the local machine you can send an image and get an appropriate response:
from SimpleDataTransport import DataSender
import numpy as np
img = np.zeros((1080, 1920))
response = DataSender(img)
print(response) # {'message': 'image received. size=1920x1080'}
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 Distribution
Built Distribution
File details
Details for the file SimpleDataTransport-1.4.tar.gz
.
File metadata
- Download URL: SimpleDataTransport-1.4.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61fa07ca61585b4fd3070ae033d1fec9574c54c913d4ad1fc8cd90f35c86dfc6 |
|
MD5 | 0009172063fda4d084da9f8c4e02d401 |
|
BLAKE2b-256 | d74737c4a84a4720943ef1933f46a2429c0b7fa3e83d180e6e3e55a7e83baeef |
File details
Details for the file SimpleDataTransport-1.4-py3-none-any.whl
.
File metadata
- Download URL: SimpleDataTransport-1.4-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c6538f8534f3c2aff6f1e3cabe48085203ec479cb231ba8885180283f9dc2e5 |
|
MD5 | 6ffe50f1683b9d45cd740b64ae14b5d5 |
|
BLAKE2b-256 | e3dbf895f4c972e28a7e0365262b184790eab7c925ab25ec341cf4ebbe4d0ca7 |