Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for SimpleDataTransport, version 1.4
Filename, size File type Python version Upload date Hashes
Filename, size SimpleDataTransport-1.4-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size SimpleDataTransport-1.4.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page