All documentation
WebSockets

Presence in Python

Check live online count, full presence snapshot, and whether a specific identifier is online in Python.

Python

Overview

PulseGrid presence in Python lets you track who is online, how many are online, and whether a specific identifier is currently active.

Setup

Use: - presence() - online_count() - is_online(identifier_id) Over websocket you can also use: - request_presence_snapshot() - check_presence(identifier_id)

Code example

Presence in Python
channel = pulsegrid.channel("demo-channel")

print(channel.presence())
print(channel.online_count())
print(channel.is_online("user_123"))

connection = channel.connect(
    client_token=token,
    on_message=lambda payload: print(payload),
)

connection.request_presence_snapshot()
connection.check_presence("user_123")

Notes

Useful for chat apps, support systems, collaboration tools, and live activity tracking.