Streamline your stream processing.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slipstream_async-1.0.6b0.tar.gz.
File metadata
- Download URL: slipstream_async-1.0.6b0.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05fe2688eb61bc69d0290b39cafd00c74ef13a4a83c119cc375b3a178a9f4d8e
|
|
| MD5 |
a7c9d583f45d38846946f313b1aba531
|
|
| BLAKE2b-256 |
9e8405390ab6fb19c31f1e9471c1b7f61531ebc38a238b26e3ba41cc6e4e2d8e
|
File details
Details for the file slipstream_async-1.0.6b0-py3-none-any.whl.
File metadata
- Download URL: slipstream_async-1.0.6b0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f514fd2fc8f63cbdf5df7750056a0f801f98c2a697bfdd89c3a55f0d832b5f96
|
|
| MD5 |
7e88cf195b10c9b9f9c988904e2d02f1
|
|
| BLAKE2b-256 |
73dcccccc4d906a09a1ab6ba81b06dd80385c859c25bad82792ce581b844269e
|