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
Async iterables are sources, (async) callables are sinks.
Decorate handler functions using handle, then run stream to start processing:
Multiple sources and sinks can be provided to establish many-to-many relations between them.
The 4 emoji's were printed using the callable print.
Quickstart
Install aiokafka (latest) along with slipstream:
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
Follow the docs and set up a Kafka connection: slipstream.readthedocs.io.
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.1.tar.gz.
File metadata
- Download URL: slipstream_async-1.0.1.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a419e8f49222e345567c5faab65b05e64c027bf34d805cdd2341779f144b4d5
|
|
| MD5 |
44c7fa2f03b6abb476e361bbad0a3e67
|
|
| BLAKE2b-256 |
5f5c91034c0e4923c22134830c5b8c4465708139796b570a72dbd85580a26634
|
File details
Details for the file slipstream_async-1.0.1-py3-none-any.whl.
File metadata
- Download URL: slipstream_async-1.0.1-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32e299a6d431141a16f10490050fe6bfd2e0f9fce8f0cea6bb2e698af14a8f49
|
|
| MD5 |
7bf7fe39b0736920cfa886ecf0cdfbb1
|
|
| BLAKE2b-256 |
d3d30030dd1475696a9c8a8dfed8522fa8e478cd0f078f4cff807c85d8805f3a
|