iridis, with python
Project description
pyridis
pyridis is the API and plugin to support python scripts inside iridis
It consists in two main APIs:
pyridis-api: the primary API used to implement each node in the dataflow graph.pyridis-message: the secondary API used to implement messages to be passed between nodes
The main part of this project is then the PythonFileExtPlugin, which is a plugin compiled as a cdylib that must be passed
to the iridis runtime in order to be able to load .py files as a node.
Usage
In a single .py file, you can define a node like this:
from typing import Any, Dict
import asyncio
import time
from pyridis_api import Node, Input, Inputs, Outputs, Queries, Queryables
class MySink(Node):
input: Input
def __init__(self):
pass
async def new(self, inputs: Inputs, outputs: Outputs, queries: Queries, queryables: Queryables, config: Dict[str, Any]):
self.input = await inputs.with_input("in")
async def start(self):
while True:
try:
message = await self.input.recv()
print(message.data[0])
except:
break
def pyridis_node():
return MySink
Then you must load the PythonFileExtPlugin to your rust iridis runtime:
let runtime = Runtime::new(
async |file_ext: &mut FileExtManagerBuilder, _url_scheme: &mut UrlSchemeManagerBuilder| {
file_ext
.load_dynamically_linked_plugin(PathBuf::from("/path/to/libpyridis_file_ext.dylib"))
.await?;
Ok(())
},
)
.await?;
Note: it's also possible to load this plugin statically with .load_statically_linked_plugin::<PythonFileExtPlugin>()
Finally you can load your nodes into the runtime just like rust nodes:
runtime
.run(flows, async move |loader: &mut NodeLoader| {
loader
.load_url(
Url::parse("file:///path/to/script.py")?,
source,
serde_yml::from_str("frequency: 1.0")?,
)
.await?;
loader
.load_url(
Url::parse("file:///path/to/other_script.py")?,
sink,
serde_yml::from_str("")?,
)
.await?;
Ok(())
})
.await
Before you try to run anything, you must have activated a python virtual environment. Tests have been made with uv and it works just fine:
uv venv --python 3.12 # the version must match the one used to compile the 'libpyridis_file_ext` in case of dynamic linking
source .venv/bin/activate # or 'activate.fish', or 'activate.ps1' ...
Then you will need the api:
uv pip install pyridis-api pyridis-message pyarrow numpy
And finally you can build your application:
cargo build -p name-of-your-crate
However, the generated executable will not be able to find the correct python libs of the environment by default. You will need to tweak the
LD_LIBRARY_PATH:
source .venv/bin/activate
export LD_LIBRARY_PATH=$(echo $(cat .venv/pyvenv.cfg | grep -i home | cut -d '=' -f 2)/..) # adjust to reflect the location of your .venv
cargo run -p name-of-your-crate
For a complete example of a project with multiple nodes—see pyridis-benchmark.
Examples
Multiple examples can be found in this directory and can be launched with just:
Example of message definitions
just enum_inherit
Example of applications
just io_runtime
just service_runtime
Rust
For now it's only possible to interact with an iridis runtime with rust. See iridis for a detailed description of the project
Benchmark
See pyridis-benchmark for a detailed description of the benchmark.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyridis_message-0.3.5.tar.gz.
File metadata
- Download URL: pyridis_message-0.3.5.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2617d31a6789198b226005a872f092d8055cbeda8be2225df28bd9f07d3b565
|
|
| MD5 |
eb87071756fe1cd31e335f8d7ccbe3bd
|
|
| BLAKE2b-256 |
744c86954e393e44a6fc71d409c7e1c156283188e67f55776b49bd3242aafefd
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-win_amd64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-win_amd64.whl
- Upload date:
- Size: 101.2 kB
- Tags: CPython 3.13t, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9ba025f1ceb6831e27110538935b64ce80fe28b28106f2aa28c3f51eb832b69
|
|
| MD5 |
cc295a31090a110fd3516babc9ce5fb6
|
|
| BLAKE2b-256 |
5b7bb6581f799188c78e3fee035a06cd99f26f5ccae4f4e8889cd95186697763
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-win32.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-win32.whl
- Upload date:
- Size: 97.7 kB
- Tags: CPython 3.13t, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afd1184b3c36f492261bd9b8c18bdddd32bf6367f7fcbdf060120616179316a9
|
|
| MD5 |
86935913f89cb2974d7e6a6bcb01ebb3
|
|
| BLAKE2b-256 |
b3a7c11536862ddd74a346df40a412e4377d733c4d34a1d73e21e3524fb92479
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 230.1 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0025fff397525a54d371af7fe724e86a022c818aaaf8043f11f8913396d09309
|
|
| MD5 |
1c243bfe211aea13030b6ca5be320596
|
|
| BLAKE2b-256 |
819981d9d82ac17c021b8f92d246b29e520d845ea90cd60eb6de5d277e4d1c5a
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 265.6 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dfadf772cefecdf2d190f47b64a53b2778cafd2ffbc3eda42520942dac01d6e
|
|
| MD5 |
86772f3cf048d0bcebbea55494fa62bd
|
|
| BLAKE2b-256 |
7df2a3f61c4aa6de04acfc1903abafc8d12283017018391dddd7c19a1ae02900
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 334.4 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1d31dbe2a1bae797cad47be445940035028cf6e4dd74d0643d53c546b9e5242
|
|
| MD5 |
0305a8d6c0513ae805929daef215ed5a
|
|
| BLAKE2b-256 |
e72b8fb4f3f3ed8f310598c2c24d0567c36f518873339c7654253f9bf1491e39
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 239.6 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8152a81a008722976a1dd182594d58bac8a685a0f0bf394dc78a804d0580235e
|
|
| MD5 |
f5cc5d830f442fbac9b3b069e3cec607
|
|
| BLAKE2b-256 |
41bcf82859f9fb40a653fa67c35948e65ce82451d4c19d8e44c9a249b5f0a2ae
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 233.1 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edfe2255b85d5911120aaf5ce889ef1e3021d7537f68a7a9db959a6b15c38513
|
|
| MD5 |
f228a51c1c29c9a4e4e05375103fd771
|
|
| BLAKE2b-256 |
b757349fcc8044c2e61d26aa07164ecbe3410390e0493922d3d78a90192d8816
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl
- Upload date:
- Size: 247.4 kB
- Tags: CPython 3.13t, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52e46b185c2cef129052e1e30d2a9489d855e3880183c95187af1409d28e2b02
|
|
| MD5 |
9af1cebf6bcbb10aeceb4d08b6665ea0
|
|
| BLAKE2b-256 |
4535b76c48ec52425936a7eca6bd9233446b541928a919d02df9c9fc7ec8ecf6
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-macosx_11_0_arm64.whl
- Upload date:
- Size: 204.7 kB
- Tags: CPython 3.13t, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cee363a07b436bae4fa670d662d79ae6fbe3a4dfff6cd551dc82a89f1e76190b
|
|
| MD5 |
c7d4802ee3efdf1fa7f9649ff15a01f5
|
|
| BLAKE2b-256 |
bcc71594e1680e2618844cac8e201800e92cdefb8977dfa65ce641fe8540340b
|
File details
Details for the file pyridis_message-0.3.5-cp313-cp313t-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp313-cp313t-macosx_10_12_x86_64.whl
- Upload date:
- Size: 209.3 kB
- Tags: CPython 3.13t, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5474bfacace2514b9887470abec44a41503ba1e66f1950d99bba8e5a7c062944
|
|
| MD5 |
4d590cfb83fb68dcd3af347910b81be6
|
|
| BLAKE2b-256 |
454e66e7db26be7527eefb08544a29641eaf1f03d807396c7c47caf89ced4228
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 103.5 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54aae4ae8c07b42437282acedeb819ce123133819e5042a0cdce68f3e616ecae
|
|
| MD5 |
ea76c799c470e9d559aaea480e9cde02
|
|
| BLAKE2b-256 |
621a5bab49b3a511e8389b985bffcd652781fad5591be8b6e6172f40f3d66058
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-win32.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-win32.whl
- Upload date:
- Size: 99.6 kB
- Tags: CPython 3.8+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30ae81195b20856e631b21d963dd512b14f94e123518ae0d1d8d96456bd5f06b
|
|
| MD5 |
62ef683750805c7aa7ce972bef2981ce
|
|
| BLAKE2b-256 |
b4ad25799b05579cd826cad1d30f31a6e0810001e122eb213643ce1147b25c86
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 232.4 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dd2b46674a50c0bef5e3770bc43305b7f2c74d0debd2c71265aebe26f288293
|
|
| MD5 |
e5e835874a0e2e223c3cf8e946493cde
|
|
| BLAKE2b-256 |
5c9c12eea157bd29aa0bfe52766604daceca1c784f4097e947f2f7f5b6f9341d
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 268.3 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f474e733a27a568e54ad5cbca81eca22da16ee3f0b350233c734b1ead6c7f309
|
|
| MD5 |
94a1fde50f00e56bb9e4c54114deee5c
|
|
| BLAKE2b-256 |
962b5d24d8d9674f3fec7cff72c02011f744b4cb63c5911bfe6045dac33dd19b
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 340.8 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd7fabcb5dc2da07af9e75e5c328f5fb5297e78603f57ce5470012900bfcc739
|
|
| MD5 |
172e10a2251d0e6b19e41a849f5f61c6
|
|
| BLAKE2b-256 |
2b9bcb3663b6bf074a5a637752e8e1821b5788ab966d877441ff33ed45252511
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 242.3 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7f1d30adfa8dda4fe6d20db333acaff83d459d3084bdd2c078d3f8b5d04d7db
|
|
| MD5 |
b6a97fb02cd18cfd266d4f09ed61ef6b
|
|
| BLAKE2b-256 |
89cb5be5eb000c77f10d419dd23c95a105f4b10d0fce734e0ff21db9a8e147fa
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 236.0 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cc94e1f73ff37feb8b474923ea02b688a70f389ed6ed169094814ef66aba73a
|
|
| MD5 |
b3abd0d25208c223d9c743ef1516c754
|
|
| BLAKE2b-256 |
88a93efd1ff66e5ff69e397f59394b6d6f70eeae6d520242e74eb747ba29ece0
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
- Upload date:
- Size: 250.6 kB
- Tags: CPython 3.8+, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9e7d2d32d87b66f5b670585b90fbcfaa9c472fff68bbc1c83cfa5219b660a87
|
|
| MD5 |
8bcc9a5e17576eeb5e361c77dcd89a1e
|
|
| BLAKE2b-256 |
8623557a4cc01b280db6b4438182312fc4e330e13bf6ce6ca9f024e5b6695c78
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 208.4 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e762def1338398c0041232da05b79ad51461bd26618ede108d930f096b9e889a
|
|
| MD5 |
2e28af08e3648aee66cf08fad8f15b5d
|
|
| BLAKE2b-256 |
600df4be918154d3b1f8e06754fea941d52b5cfa50fccb2d59246edc2584968d
|
File details
Details for the file pyridis_message-0.3.5-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyridis_message-0.3.5-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 212.8 kB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d062f05ed06d84beffcbbfc7035a23a070400695d803bb663aa5b85a788c6b32
|
|
| MD5 |
6d3056b70d8449b61ec64c2b2ea45f41
|
|
| BLAKE2b-256 |
e8adce2897c14b8a45b8f469eeb62c9f39d8b6f44a531b90d087e322b4789063
|