Skip to main content

Eyegway


Intro

Eyegway is a python package for data routing through Redis / Dragonfly / KeyDB. It is designed to be a simple and easy to use package for sending any data from a generic source to a generic destination by exploting HUBs(and)SPOKES paradigm. The user can send data to a generic HUB, which has a data queue and a data history, and the data can be pulled from anywhere else.

The library needs a running instance of Redis / Dragonfly / KeyDB to work.

Installation

pip install -e .

Basic Usage

Create a Hub

In order to use the machinery, you need to create a Hub with a unique name which is used to identify the hub across the network:

import eyegway.hubs.asyn as eha
hub = eha.AsyncMessageHub.create(name='my_hub')

This method will create a new hub with the given name using default settings retrieved from environment variables.

How to override default settings?

Programmatically Override Settings

If you want to override the default settings, you can pass a configuration dictionary to the create method:

import eyegway.hubs as eh
config = eh.HubsConfig(max_buffer_size=1000)
hub = ehs.MessageHub.create(hub_name, config=config)

Override Environment Variables

Set the following environment variables before launching the application:

eyegway_hubs_redis_host="localhost"
eyegway_hubs_redis_port=6379
eyegway_hubs_max_buffer_size=10
eyegway_hubs_max_history_size=10

Send and Receive Data from/to the Hub

Then you can send data to the hub:

await hub.push({'counter':0})

From another process/node, you can pull the data from the hub:

import eyegway.hubs.asyn as eha
hub = eha.AsyncMessageHub.create(name='my_hub')
data = await hub.pop()
print(data)

The pop method will remove the data from the hub's queue. If you want to read the data without removing it, you can use the last method:

data = await hub.last(offset=0)
print(data)

Examples

You can find more examples (both for Async and Sync version of the hubs) in Hubs Examples

CLI Usage

Eyegway comes with a CLI tool to interact with the hubs. You can use the eyegway command to interact with the hubs.

eyegway hubs

For example:

eyegway hubs search # List all the hubs

eyegway hubs info -n $HUB_NAME # Get information about the hub

eyegway hubs last -n $HUB_NAME # Print the last data in the hub in a fancy way

eyegway hubs stream-demo -n $HUB_NAME # Stream demo data to the hub

API Rest Server

Eyegway comes with a REST API server to interact with the hubs. You can use the eyegway command to start the server.

eyegway hubs rest-serve

Then go to http://localhost:55221/docs to see the API documentation (where 55221is the default Eyegwat port, you can change it using the --port option).

WebUI

If the REST API server is running, you can run the battery-included WebUI to interact with the hubs. The webui is a Svelte package available in the relative websubfolder, see: Eyegway Svelte for more details.

Metadata

Release files for eyecan-eyegway 0.6.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eyecan-eyegway 0.6.6
File Size Uploaded
eyecan_eyegway-0.6.6.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eyecan-eyegway 0.6.6
File Interpreter ABI Platform
eyecan_eyegway-0.6.6-py3-none-any.whl Python 3 none any Details

Total release size: 51.9 kB

Release files / eyecan_eyegway-0.6.6.tar.gz

Download URL eyecan_eyegway-0.6.6.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
08a8ec9a93f45c18d7f14321d94bea9a3458c19e74d7f8b16799584c55fa0613
BLAKE2b-256 checksum
How to use checksums
625ec2da868c18cb99474960658c8b23b1ce6d55373aa896739c8f5a705d10b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / eyecan_eyegway-0.6.6-py3-none-any.whl

Download URL eyecan_eyegway-0.6.6-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b05ee547f5ef3c2b670f484ffb1ef135d7bace53a52c8fbc4df6eb86c497ce9
BLAKE2b-256 checksum
How to use checksums
3531c7a7499557f2f3e0edd213ea670e3581d972d14da8b0eae499912a5179ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.6.7

2 release files

This release

0.6.6 This release

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page