Skip to main content

flowwatch-client (Python)

Python client for FlowWatch — connects to a running FlowWatch sidecar over HTTP.

Install

pip install flowwatch-client

Usage

Start the FlowWatch sidecar in your Node.js app:

import { createFlowwatch, startSidecar } from "@pranshulsoni/flowwatch"

const fw = await createFlowwatch({ ... })
startSidecar(fw, { port: 9400, token: process.env.SIDECAR_TOKEN })

Then use the Python client:

from flowwatch import FlowwatchClient

fw = FlowwatchClient(base_url="http://localhost:9400", token="your-token")

# Feature flag
enabled = fw.flag("new-checkout", context={"userId": "u_123", "plan": "pro"})

# Trigger a workflow
result = fw.trigger("send-welcome-email", input={"userId": "u_123"})

# Record a trace span
fw.trace_span(name="db.query", type="db", duration_ms=42)

# Capture an error
fw.capture_error(message="Something broke", source="api", name="ValueError")

# Health check
status = fw.health()  # {"status": "ok", "sidecar": "flowwatch"}

fw.close()

Use as a context manager:

with FlowwatchClient("http://localhost:9400", token="your-token") as fw:
    enabled = fw.flag("dark-mode")

API

Method Description
flag(key, context?) Evaluate a feature flag → bool
trigger(name, input?) Trigger a workflow → dict
trace_span(name, type, duration_ms, metadata?, status?) Record a trace span
capture_error(message, source, name?, stack?) Capture an error
health() Sidecar health check → dict
close() Close the HTTP connection

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowwatch_client-3.1.4.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

flowwatch_client-3.1.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file flowwatch_client-3.1.4.tar.gz.

File metadata

  • Download URL: flowwatch_client-3.1.4.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for flowwatch_client-3.1.4.tar.gz
Algorithm Hash digest
SHA256 f3f17edf7da61b856be5e64925a586e7479ff8b6e37e3b3faef8d9e83643c79f
MD5 438c6f77e34c2ae8f4d3014272acb3dc
BLAKE2b-256 7ae2d0f145def354cf0184c399aa37e4ac70db7fcf82feb1d9b72e1f53819b25

See more details on using hashes here.

File details

Details for the file flowwatch_client-3.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for flowwatch_client-3.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e17ba8994ed2ef5d8238e38e308e32b17e27e6bef0f09a4d57e36deaa4296d15
MD5 a20b2fe72af270a9cbae1631fe078a52
BLAKE2b-256 a8b031c26fd7120ff3e3380cd865490f46c6ab82176660e4fbbeab1c7bea9d40

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