Metadata-Version: 2.4
Name: skarv
Version: 0.1.0
Summary: A single process, in-memory message queue written in python.
Author-email: "PLACEHOLDER: Author Name" <author@example.com>
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: eclipse-zenoh<2.0,>=1.0
Dynamic: license-file

# skarv

> **skarv** is a Swedish noun that refers to the point where two things are joined together. Translations to English includes joint, splice, connection and similar words. Interestingly, it is also the swedish word for cormorant (the bird).

## What?

A simple, synchronous, thread-safe, single process, in-memory message "broker" written in python. 

## Why?

Because I wanted the most simplistic API (subjectively) I could possibly think of for processing real-time data from multiple sources to multiple sinks via any intermediate processing setup.

## How ?

By re-using the concept of [`Key Expression`](https://github.com/eclipse-zenoh/roadmap/blob/main/rfcs/ALL/Key%20Expressions.md)s from [`Zenoh`](https://zenoh.io/) and utilizing in-memory storage for a very simplistic implementation of a message "broker" that supports the following operations:
* Putting data to the broker
* Subscribing to data from the broker
* Getting the latest data from the broker

## Usage

```python

import skarv

@skarv.subscribe("any/**")
def _(sample: skarv.Sample):
    print(sample.key_expr)
    print(sample.value)

skarv.put("any/thing", 42)

samples = skarv.get("any/**")

print(samples)
```

## Installation

```
pip install skarv
```
