Skip to main content

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

Project description

flowwatch (Python)

Python client for FlowWatch. Wraps the FlowWatch sidecar REST API — requires the sidecar server to be running.

Install

pip install flowwatch-client

Usage

from flowwatch import FlowwatchClient

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

# Feature flag
if client.evaluate_flag("new-billing-flow", {"userId": "u123", "plan": "pro"}):
    use_new_flow()

# Durable workflow
result = client.trigger_workflow("checkout", {"cartId": "cart_1"})
print(result["executionId"])

# Auto-timed trace span
with client.trace_span("process-order", "function"):
    process_order()

# Error capture
try:
    risky()
except Exception as e:
    import traceback
    client.capture_error(str(e), stack=traceback.format_exc(), source="my-service")

# Health check
print(client.health())

client.close()

Async

from flowwatch import AsyncFlowwatchClient

async with AsyncFlowwatchClient("http://localhost:9400", token="your-token") as client:
    enabled = await client.evaluate_flag("dark-mode", {"userId": "u1"})
    result = await client.trigger_workflow("send-email", {"to": "user@example.com"})

Project details


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-2.1.0.tar.gz (2.7 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-2.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for flowwatch_client-2.1.0.tar.gz
Algorithm Hash digest
SHA256 32687c9a7e51fad413278147d79deb0863e53b5241176b69db4d5ee3e915c915
MD5 3a93f3743e51d2125e8a5421f2026b2f
BLAKE2b-256 1e2104c8fb20c63f658ddc4cd67a6a90921039cde152d196b07c060893d8c567

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flowwatch_client-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e09ec7289b766845f9fbea88aa32be18597c85f5d6840cb0e0b24a2b37d6a18
MD5 d54110ed5c3462b0567a09960f2f2d4d
BLAKE2b-256 9f72b41727034bbc2a0a7da56253b5dcec5ee022c1bbea1699d5931678e865fc

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