Python client for sending events to an postDash server.
pip install ./sdks/pythonfrom postDash import Client
er = Client("http://localhost:6060/events", "myapp")
er.emit("deploy", {"env": "prod"})
er.error("crash", {"msg": "something broke"})
er.warn("high_latency", {"p99": 450})
er.debug("cache_miss")
er.flush() # wait for pending events before exitdeploy = er.with_channel("deploy")
deploy.emit("started", {"branch": "main"})with er.timed("db_query") as t:
result = do_query()
t.data["rows"] = len(result)When the URL is empty, all operations silently no-op:
import os
er = Client(os.environ.get("POSTDASH_URL", ""), "myapp")
er.emit("startup") # safe even if POSTDASH_URL is unsetPython 3.10+