Slipstream
Slipstream provides a data-flow model to simplify development of stateful streaming applications.
pip install slipstream-async
from asyncio import run
from slipstream import handle, stream
async def messages():
for emoji in '🏆📞🐟👌':
yield emoji
@handle(messages(), sink=[print])
def handle_message(msg):
yield f'Hello {msg}!'
if __name__ == '__main__':
run(stream())
Hello 🏆!
Hello 📞!
Hello 🐟!
Hello 👌!
Usage
Slipstream components interoperate with basic python building blocks:
Any-thing can be passed around as data- Any
Callablemay be used as a sink AsyncIterablesact as sources- Parallelize through
handle
A many-to-many relation is established by passing multiple sources / sinks.
Quickstart
Install Slipstream along with aiokafka (latest):
pip install slipstream-async[kafka]
Spin up a local Kafka broker with docker-compose.yml, using localhost:29091 to connect:
docker compose up broker -d
Copy-paste this snippet.
Features
slipstream.handle: bind streams (iterables) and sinks (callables) to user defined handler functionsslipstream.stream: start streamingslipstream.Topic: consume from (iterable), and produce to (callable) kafka using aiokafkaslipstream.Cache: store data to disk using rocksdictslipstream.Conf: set global kafka configuration (can be overridden per topic)slipstream.codecs.JsonCodec: serialize and deserialize json messagesslipstream.checkpointing.Checkpoint: recover from stream downtimes
Metadata
Release files for slipstream-async 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| slipstream_async-1.0.5.tar.gz | 32.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| slipstream_async-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.9 kB
Release files / slipstream_async-1.0.5.tar.gz
| Download URL | slipstream_async-1.0.5.tar.gz |
|---|---|
| Size | 32.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12b1dabd28ebac07a77eaa8bdb90793144c907861e463333268a81880bb2ba75
|
|
BLAKE2b-256 checksum How to use checksums |
05265bb96c497cfcf29f97342153311369e1a1a6e31835968c72b897d8b1c565
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Release files / slipstream_async-1.0.5-py3-none-any.whl
| Download URL | slipstream_async-1.0.5-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b21ee7beea11d581d951be2f2aa0fe6c0acefc3eec7b7a36dc5a9f78200c0c8
|
|
BLAKE2b-256 checksum How to use checksums |
f64dd9f89373f02db12780723cb4228d07e43eab255ad3aa1bf4f7dce8b68a0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|