Skip to main content

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.

Benchmark Latency

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

pyridis_api-0.3.5.tar.gz (24.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyridis_api-0.3.5-cp313-cp313t-win_amd64.whl (356.3 kB view details)

Uploaded CPython 3.13tWindows x86-64

pyridis_api-0.3.5-cp313-cp313t-win32.whl (330.3 kB view details)

Uploaded CPython 3.13tWindows x86

pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (550.5 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ x86-64

pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl (592.6 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ s390x

pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (648.0 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ppc64le

pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (550.4 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ARMv7l

pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (557.5 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ARM64

pyridis_api-0.3.5-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl (583.3 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.5+ i686

pyridis_api-0.3.5-cp313-cp313t-macosx_11_0_arm64.whl (486.6 kB view details)

Uploaded CPython 3.13tmacOS 11.0+ ARM64

pyridis_api-0.3.5-cp313-cp313t-macosx_10_12_x86_64.whl (499.0 kB view details)

Uploaded CPython 3.13tmacOS 10.12+ x86-64

pyridis_api-0.3.5-cp38-abi3-win_amd64.whl (362.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

pyridis_api-0.3.5-cp38-abi3-win32.whl (337.8 kB view details)

Uploaded CPython 3.8+Windows x86

pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (556.7 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (604.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ s390x

pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (657.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (557.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARMv7l

pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (563.8 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

pyridis_api-0.3.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl (593.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.5+ i686

pyridis_api-0.3.5-cp38-abi3-macosx_11_0_arm64.whl (499.7 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

pyridis_api-0.3.5-cp38-abi3-macosx_10_12_x86_64.whl (511.6 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file pyridis_api-0.3.5.tar.gz.

File metadata

  • Download URL: pyridis_api-0.3.5.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.3

File hashes

Hashes for pyridis_api-0.3.5.tar.gz
Algorithm Hash digest
SHA256 797bb2d9339ab96880907cc177598fe4dce038cf684d5b5a52f0dd151a4d9fff
MD5 ee9dd6d432c66a196bb7f62374483f93
BLAKE2b-256 534d98fcfadaddfebab14f402fd3d34550f005e9d881e71758deef3fb12ed618

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-win_amd64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 fd1a58847feabc1c0cbd7cde27d457d8c324b388916e0669d9870cd8062eee61
MD5 17ac44431f09da3f24b32e27765171fc
BLAKE2b-256 6b6d1b450b95cd81d356091d31e7ca87b425f1d8f2314e1b7e9eb6acdce267af

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-win32.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-win32.whl
Algorithm Hash digest
SHA256 84626cb9884f701dcb94885c3d7fe0e717d07c36310393e1b69f45aa32c6a0fd
MD5 f4ca5b846efa65c523d66384e2498579
BLAKE2b-256 648b9ac98a8fff3ad68a3980dffdc75b3c4692b150abae3d0c6a795504a6838c

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56ec3bad7b0f29c0f96f74155d91d9c96be9dcdb36ffa7385bfe8f1d09278bd1
MD5 dd1668a94c5b57aba1cb6cefd9411365
BLAKE2b-256 5608191bc9d5ab6059fc62c13941ab07a7cb8a9f6fe684fb40cbb738d0988bee

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 66a72ab0208d7cb19c89ed5057efc2005cc67a7ed11ea0c503ee2968a3825a24
MD5 b846a6a58ad1afa93c2d1f9db9918648
BLAKE2b-256 daa82e17eaf9cd6d6822e5d904c4e0c73b503193b65c9e30e9ae0f77ddd54402

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 264de0fbca0a051e2ffb2d8762af763601eb2eb1b2548965f2bad64bd0728d58
MD5 913f2fe7df42bf5a957871200c50fccb
BLAKE2b-256 66bec0edb843290c5f979617d24543447046c7de7399f6be5a6093ad70032fe7

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f16b5fcaa2e9661c0af25d756e1292d64c7ae6a6a850bd0ce3def62dc3efdcd8
MD5 ad5ef965da7837c12015b0b1e190dc0d
BLAKE2b-256 defce4f4e32cb427011bf5ea8db26d2526619bfc1729887295f35f0fb81af1b3

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8efc1e96fab0901df274d44a052cd74af66b9ebcf438443efea602e718bf62e7
MD5 6f3f276bc43d7fe9a6f6a837814d8b3a
BLAKE2b-256 79c7e3cddfe1e8e3366421e16b2228b87aa1fea76cb82e8f672f6679ff40628a

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 bf09f8fd3ebabcb39dc03d45db6e5373fd13af7230d88155eee029a6d74287f7
MD5 bf0271d6ee0c57ae81b92573b418556f
BLAKE2b-256 3551f2d19c3b6f239610e56edb9e94bcce9a53f6135195bdd87b7b552460e902

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 853f672140550a4001614052f3f885bffc55f81c627ea7b7dc43dcc410956e1c
MD5 ddea7c1bcbe63c8bf0244ba2b5a03b6a
BLAKE2b-256 26eef09ca3b8849f72cc4de77b1cee67bf9d720e1b11da368ce43565780e436b

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp313-cp313t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp313-cp313t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f44331ce06383620af1fd68188c191d51aa96904ab1c1248f76a5c4db52fa6b8
MD5 227d9207d4d8eef4d9b0d0f91970847c
BLAKE2b-256 8ff96e59a53a405ac4427bc12ef4dae649b71a7bd195d3d7480e844a1564de02

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4c1a956762fde7babf742f703ba48bd0a5eccf7bb8882ff968cd5b33df0eb1dd
MD5 93d622cb303ea8204b3e9dd791d0ed50
BLAKE2b-256 c5a9a2e5a841132dbb97da9e8c536e132f4b5b5a000729b01f83ef5942c25a2f

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-win32.whl.

File metadata

  • Download URL: pyridis_api-0.3.5-cp38-abi3-win32.whl
  • Upload date:
  • Size: 337.8 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.3

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 a75a3a2d0674850d2dc859eda16370537756f9e8f0579e0827710191fb6c5893
MD5 3fa543e40e5843eb1d4e6d6d550b91a0
BLAKE2b-256 15402edcac25d9814154dce422f09624996d89dd6efefd18ffa826468d80a3f1

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c89d3a3b0df38fe6b4b774c839563f5e2863c0477d4f4a7840668bd056199e4
MD5 c10f0694d66461e3598f6924b185059d
BLAKE2b-256 7db3ca502bee2063c411e52f87a0fd4beedd0ca5cd1eb05368b5fea5a0405492

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 7cb1429e4cc0761c18f69618269b11d801d7e0ca1e879a9bd34685981f130d96
MD5 0cfb5f90bc73359f01761cbc4e2fd79b
BLAKE2b-256 222298b69ad45df048aef50b6c2629b41bdfdc9bc8d11ea5e92d836807f0540e

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 954681831954bc649b4a4b2e186dd089eb8ce481ffda747cce0d06f9e65b3374
MD5 a9a58c14c5b21f47909bda886d012b76
BLAKE2b-256 89324e1dd1628cef3acf47a407b9ee8b5eca9b1eff57f60410496cf78b9d4f75

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 3c4ab905eac49f4b4c0354a9b7db2f5dd892e1d649081eb12628b26ee66f3097
MD5 b252b2455d646582bc613ecebaa82bbd
BLAKE2b-256 03541cfe66fe697068a4190b3d6202c0a56b3bd8b7a365437bac627e07aed037

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 83a3cb68be5c72a05edfbb33773f0c62b2a9273ff7670f303ed858fa2c425463
MD5 407ae77ff78a67a12846845157391d6d
BLAKE2b-256 b10458d8f883c76e2b3da36e3dc7fe6fcdf214598a968ce36ad9831a0f7a4ab0

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 df0808ce47a93b5f33503d962fffc2ac31a4325d0e23a1f1ffd0aa42f1ee4a32
MD5 c776978070cf240f324a544bb861d51e
BLAKE2b-256 16fdcfa09857213e203b4e433f334dca5ea535fd1f3af275ae50c921b9de795d

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 625399431d578091ff20feb007b92c5c621e3eff3ffedfc6ab29255eebaec1d1
MD5 11afb8c0bb52b9e1ce8aa3088d5b0085
BLAKE2b-256 9bb49fe9087ee64e04bc080225766a21a6e1d6cc54756a9ba982a3b30c835a22

See more details on using hashes here.

File details

Details for the file pyridis_api-0.3.5-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyridis_api-0.3.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ef67e72ba025e3bd02a2991cc2ba72fee84c32b5c306b3ec2903992284dcd2e6
MD5 ff3464aa0c6ff4cc3335f9ca7c6a6f13
BLAKE2b-256 5d3c53fd718f52569ab0fb3eb6ce5149aaa613c6ba75b37ab082ea1fc93d8545

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page