Skip to main content

flowwatch-client (Python)

PyPI version Monthly downloads License Python versions

Python client SDK for FlowWatch — feature flags, durable workflows, request tracing, and error capture.

This SDK talks to a lightweight sidecar HTTP server that you run alongside your Node.js FlowWatch app. See the full documentation for setup instructions.

Installation

pip install flowwatch-client

Prerequisites

You need the Node.js FlowWatch package running with the sidecar enabled:

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

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

Usage

from flowwatch import FlowwatchClient

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

# Feature flag
if client.evaluate_flag("new-checkout", {"userId": "user_123"}):
    render_new_ui()

# Trigger a workflow
client.trigger_workflow("send-order", {"orderId": "ord_456", "amount": 4999})

# Capture an error
try:
    do_something_risky()
except Exception as e:
    import traceback
    client.capture_error(str(e), stack=traceback.format_exc(), source="worker")

# Auto-timed trace span (context manager)
with client.trace_span("db-query", type="db"):
    rows = db.execute("SELECT * FROM products")

# Health check
status = client.health()

client.close()

Async support

Use FlowwatchAsyncClient for async codebases (FastAPI, asyncio):

from flowwatch import FlowwatchAsyncClient

async def handler():
    async with FlowwatchAsyncClient("http://localhost:9400", token="your-token") as client:
        enabled = await client.evaluate_flag("new-checkout", {"userId": "user_123"})

License

ISC

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.2.tar.gz (3.2 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.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flowwatch_client-3.1.2.tar.gz
  • Upload date:
  • Size: 3.2 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.2.tar.gz
Algorithm Hash digest
SHA256 f7638202158cbb8c5662e953713a1be654da2231cb2e755ca3da1ea834357c3d
MD5 0a74d216dfc5971ec62d77330c19f849
BLAKE2b-256 c50de98861856d79bec7c8360a4233a64a84d7c782b7f6fd6d4342e753e60f37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flowwatch_client-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ecbd6baf6a4eea86fae3073f09051022d9eefdddc141dfc0282def61bb6faab
MD5 f71ee1fa3e3f2a9935370ce597e3c9c3
BLAKE2b-256 7b974298cc006e8a6fc76afb4222d0778bb5337047ef5fe5b697e70a7621ab79

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