Getting Started¶
This is the "Getting Started" streamdaq v2 notebook.
In [1]:
Copied!
!uv pip install --quiet streamdaq
!uv pip show streamdaq
!uv pip install --quiet streamdaq
!uv pip show streamdaq
error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment
Using Python 3.11.16 environment at: /opt/hostedtoolcache/Python/3.11.16/x64 Name: streamdaq Version: 2.0.0 Location: /opt/hostedtoolcache/Python/3.11.16/x64/lib/python3.11/site-packages Requires: datasketch, datasketches, dill, fastapi, lmdb, pathway, pydantic, strenum, uvicorn Required-by:
In [2]:
Copied!
'''
from streamdaq import StreamDaQ, DaQMeasures as dqm, Windows
# Step 1: Configure your monitoring setup
daq = StreamDaQ().configure(
window=Windows.tumbling(3),
instance="user_id",
time_column="timestamp",
wait_for_late=1,
time_format='%Y-%m-%d %H:%M:%S'
)
# Step 2: Define what Data Quality means for you
daq.check(dqm.count('interaction_events'), assess="(5, 15]", name="count") \
.check(dqm.max('interaction_events'), assess=">5.09", name="max_interact") \
# Step 3: Start monitoring and let Stream DaQ do the work
daq.watch_out()
'''
'''
from streamdaq import StreamDaQ, DaQMeasures as dqm, Windows
# Step 1: Configure your monitoring setup
daq = StreamDaQ().configure(
window=Windows.tumbling(3),
instance="user_id",
time_column="timestamp",
wait_for_late=1,
time_format='%Y-%m-%d %H:%M:%S'
)
# Step 2: Define what Data Quality means for you
daq.check(dqm.count('interaction_events'), assess="(5, 15]", name="count") \
.check(dqm.max('interaction_events'), assess=">5.09", name="max_interact") \
# Step 3: Start monitoring and let Stream DaQ do the work
daq.watch_out()
'''
Out[2]:
'\nfrom streamdaq import StreamDaQ, DaQMeasures as dqm, Windows\n\n# Step 1: Configure your monitoring setup\ndaq = StreamDaQ().configure(\n window=Windows.tumbling(3),\n instance="user_id",\n time_column="timestamp",\n wait_for_late=1,\n time_format=\'%Y-%m-%d %H:%M:%S\'\n)\n\n# Step 2: Define what Data Quality means for you\ndaq.check(dqm.count(\'interaction_events\'), assess="(5, 15]", name="count") .check(dqm.max(\'interaction_events\'), assess=">5.09", name="max_interact") \n# Step 3: Start monitoring and let Stream DaQ do the work\ndaq.watch_out()\n'