wifi-densepose/vendor/midstream/hyprstream-main/examples/client/python
rUv 407b46b206
feat: vendor midstream and sublinear-time-solver libraries (#109)
Add ruvnet/midstream (AIMDS real-time inference) and
ruvnet/sublinear-time-solver (sublinear optimization algorithms)
as vendored dependencies under vendor/.
2026-03-02 23:34:05 -05:00
..
hyprstream_client feat: vendor midstream and sublinear-time-solver libraries (#109) 2026-03-02 23:34:05 -05:00
tests feat: vendor midstream and sublinear-time-solver libraries (#109) 2026-03-02 23:34:05 -05:00
README.md feat: vendor midstream and sublinear-time-solver libraries (#109) 2026-03-02 23:34:05 -05:00
poetry.lock feat: vendor midstream and sublinear-time-solver libraries (#109) 2026-03-02 23:34:05 -05:00
pyproject.toml feat: vendor midstream and sublinear-time-solver libraries (#109) 2026-03-02 23:34:05 -05:00

README.md

Hyprstream Python Client

A Python client library for interacting with the Hyprstream metrics service. This client provides a high-level interface for storing and querying metrics using Apache Arrow Flight SQL.

Installation

# Using poetry (recommended)
poetry install

# Using pip
pip install .

Quick Start

from hyprstream_client import MetricsClient, MetricRecord

# Connect to Hyprstream server
with MetricsClient("grpc://localhost:50051") as client:
    # Insert a single metric
    metric = MetricRecord(
        metric_id="test_metric_1",
        timestamp=None,  # Will use current time
        value_running_window_sum=10.0,
        value_running_window_avg=2.0,
        value_running_window_count=5
    )
    client.set_metric(metric)
    
    # Query metrics from the last hour
    df = client.get_metrics_window(window_seconds=3600)
    print(df)

Features

  • Native Arrow Flight SQL integration
  • Efficient batch operations
  • Type-safe metric records
  • Prepared statement caching
  • Flexible query filtering
  • Time window support

Development

# Install development dependencies
poetry install --with dev

# Run tests
poetry run pytest

# Format code
poetry run black .
poetry run isort .

# Type checking
poetry run mypy .

# Linting
poetry run ruff .

License

This project is licensed under the same terms as the main Hyprstream project.