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.5.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.5-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flowwatch_client-3.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 7cd5b069f3e63f0de708eea8fc9d93480f566ef988069cc1df56d75d5f6dbfa3
MD5 b25fc4a61fd38fe376c1d8c974e6a4cd
BLAKE2b-256 e67b82fce8f1b6b245692a00d5c04af5fca8675a1406ddba7569fbdb86091a50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flowwatch_client-3.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7d158f545a5a2cdcdc13ce8dd064490b7ef634409856ab4f69593bb9e3386952
MD5 ecd7273c24ed64220727966bbab7818c
BLAKE2b-256 d39124e84abf7702c6d344432a850c863cd17ebe47e0b21f189f7164ccb3cfa6

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