Skip to main content

Async flows

Project description

Storey

Storey is an asynchronous streaming library for real-time event processing and feature extraction. It is part of the MLRun ecosystem.

Features

  • Async event processing with backpressure
  • Rich set of built-in transformations: Map, Filter, FlatMap, Batch, Choice, JoinWithTable, and more
  • Time-window aggregations with pluggable storage (V3IO, Redis, SQL)
  • Sources and targets for files (CSV, Parquet), streams (Kafka, V3IO), and databases (Redis, TimescaleDB)
  • Streaming (generator) support in Map steps

Installation

pip install storey

Optional extras:

pip install storey[kafka]       # Kafka support
pip install storey[redis]       # Redis support
pip install storey[psycopg]     # TimescaleDB support

Quick Example

from storey import build_flow, SyncEmitSource, Map, Filter, ParquetTarget

controller = build_flow([
    SyncEmitSource(),
    Filter(lambda event: event["amount"] > 0),
    Map(lambda event: {**event, "amount_cents": int(event["amount"] * 100)}),
    ParquetTarget("output.parquet", columns=["user", "amount", "amount_cents"]),
]).run()

controller.emit({"user": "alice", "amount": 9.99})
controller.emit({"user": "bob", "amount": -1.00})
controller.emit({"user": "carol", "amount": 24.50})

controller.terminate()
controller.await_termination()
# output.parquet now contains the two events with positive amounts,
# each enriched with amount_cents.

Documentation

See the MLRun documentation and the storey transformations API reference.

Contributing

See CONTRIBUTING.md for development setup, testing, and coding conventions.

License

Apache License 2.0

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

storey-1.12.0-py3-none-any.whl (113.8 kB view details)

Uploaded Python 3

File details

Details for the file storey-1.12.0-py3-none-any.whl.

File metadata

  • Download URL: storey-1.12.0-py3-none-any.whl
  • Upload date:
  • Size: 113.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for storey-1.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51cad30e682b393cf76ec7137e1281c7312934b41757ba6c20cb118169d49080
MD5 6e4f6c2e1ce95c6f721ca7af8d22f121
BLAKE2b-256 df3f7cc469ffad6831bfaba2baf9fc8242757f7a43eb06f56628d7dd1a4dc63e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page