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
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 ipc-purepy-0.1.0.tar.gz
.
File metadata
- Download URL: ipc-purepy-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f1d3e7ed54d4c24dff9b2a035295c7d61aa9c79eda0e21677e7925d88f65f98 |
|
MD5 | b1b92500568795b6f94e15c9fa5ca9e9 |
|
BLAKE2b-256 | 8437d53ba8c4321facc1207265195bfcab3a488049dad344ea5488a1054025e4 |
File details
Details for the file ipc_purepy-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ipc_purepy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8820650e129c64e1a137e2bdb606ca33ddd934736d944db500d0ab261b1cece |
|
MD5 | 12e99a80b7518fec2ac2a30aea023c49 |
|
BLAKE2b-256 | ff2976400f777b0dadb3ab22c73a04987a268e5bde437d7b69a0d443e90c8794 |