ptypy.io.interaction#

Interaction module

Provides the server and a basic client to interact with it.

This file is part of the PTYPY package.

copyright:

Copyright 2014 by the PTYPY team, see AUTHORS.

license:

see LICENSE for details.

Functions

DEBUG(x)

ID_generator([size, chars])

Generate a random ID string made of capital letters and digits.

is_str(s)

Test if s behaves like a string.

numpy_replace(obj, arraylist)

Takes an object decoded by JSON and replaces the arrays where they should be.

numpy_zmq_recv(in_socket)

Receive a JSON object, taking care of numpy arrays

numpy_zmq_send(out_socket, obj)

Send the given object using JSON, taking care of numpy arrays.

Classes

Client([pars])

Basic but complete client to interact with the server.

NumpyEncoder(*[, skipkeys, ensure_ascii, ...])

Custom JSON Encoder class that take out numpy arrays from a structure and replace them with a code string.

Server([pars])

Main ZMQ server class.