Skip to main content

Allow sent core Python objects between two likely independent Python processes using UNIX sockets.

Project description

IPC PurePy

The package allow sent core Python objects between two likely independent Python processes using UNIX sockets.

It provides a Server class (Server), a Client function (communicate), and a PyCoreObject type alias.

PyCoreObject alias:

It's a type alias defined as the union of the basic types of Python language (str, int, float, bool, None) and common collections (list[PyCoreObject] and dict[str, PyCoreObject]).
The dict type key must be are str type and value are PyCoreObject.

function is_pycoreobject(object: Any) -> bool:

This recursive function allows to check if the object passed to it is a valid PyCoreObject.

class Server(socket_path: str):

The class defines the server socket as a context handler. Through the wait_connection() method it waits for some external connection and returns the PyCoreObject sent to it.
The connection to the client is expected to be closed with the close_connection() method.
Server class implements the reply() method that allows to send a PyCoreObject to the client if the connection is alive.

function communicate(socket_path: str, data: PyCoreObject) -> PyCoreObject:

Client endpoint to communicate with the server socket, send data to server socket and expect receive a response from it.

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

ipc-purepy-0.1.0.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

ipc_purepy-0.1.0-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

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