Metadata-Version: 2.1
Name: eclipse-zenoh-flow
Version: 0.4.0_alpha.2
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Summary: The python API for Eclipse Zenoh Flow
Home-Page: https://github.com/ZettaScaleLabs/zenoh-flow-python
Author: ZettaScale Zenoh Team <zenoh@zettascale.tech>
Author-email: ZettaScale Zenoh Team <zenoh@zettascale.tech>
License:  EPL-2.0 OR Apache-2.0
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Bug Tracker, https://github.com/ZettaScaleLabs/zenoh-flow-python/issues
Project-URL: Source Code, https://github.com/ZettaScaleLabs/zenoh-flow-python
Project-URL: Documentation, https://readthedocs.org/projects/zenoh-flow/

[![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
[![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/vSDSpqnbkm)

<img src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/master/zenoh-dragon.png" height="150">


# Python Zenoh Flow API
[Zenoh Flow](https://github.com/eclipse-zenoh/zenoh-flow) provides a Zenoh-based dataflow programming framework for computations that span from the cloud to the device.

:warning: **This software is still in alpha status and should _not_ be used in production. Breaking changes are likely to happen and the API is not stable.**

-----------

### Requirements

- Rust: see the [installation page](https://www.rust-lang.org/tools/install)
- a matching version of libpython. On linux systems, it's typically packaged separately as ``libpython3.x-dev` or `python3.x-dev`.
- Python >= 3.7
- pip >= 22
- virtualenv




### How to build

Create and activate a python virtual environment:

```bash
$ python3 -m virtualenv venv
$ source venv/bin/activate
```

Build the Python Wheel **within** a Python virtual environment.

```bash
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ git clone https://github.com/atolab/zenoh-flow-python
(venv) $ cd zenoh-flow-python/zenoh-flow-python
(venv) $ pip3 install -r requirements-dev.txt
(venv) $ maturin build --release
```

**Deactivate** the venv and install the python bindings.

```bash
(venv) deactivate
$ pip3 install ./target/wheels/<there should only be one .whl file here>
```

#### Build the wrappers

Build the Python wrappers.

:warning: **Python Wrappers SHOULD NOT be built within a Python virtual environment**

```bash
$ cargo build --release -p py-op -p py-sink -p py-source
```

#### Build the docs

Once you have installed the Python binding you can also generate the documentation.
```
$ cd docs
$ pip3 install sphinx_rtd_theme sphinx -y
$ make html
```

The docs will be available under `_build/html/index.html`.


### Run an example

Clone, build and install [Zenoh Flow](https://github.com/zenoh/zenoh-flow), and then use the provided `py-pipeline.yml` example to run it.

:bulb: Note that you actually only need to update the paths in `py-pipeline.yml` file.

```bash
$ zfctl launch py-pipeline.yml
```



