cent
Python library to communicate with Centrifugo server HTTP API
What it is and what it does
Cent is a Python SDK that wraps Centrifugo's HTTP API, allowing you to publish messages to channels, manage subscriptions, and perform batch or broadcast operations from your Python application. It provides both a synchronous `Client` and an asynchronous `AsyncClient`, both built on top of `requests` and `aiohttp` respectively, and uses Pydantic models to structure API requests and responses.
The library is designed to work with Centrifugo v5 and v6 servers. It handles the low-level HTTP communication, request serialization, and error handling through a hierarchy of exceptions (CentError, CentNetworkError, CentTransportError, CentTimeoutError, CentUnauthorizedError, CentDecodeError, CentApiResponseError). For bulk operations, it supports BatchRequest and BroadcastRequest to send multiple commands in a single network round-trip, which can be significantly faster than sequential individual publishes.
Use it for:
- Publish real-time messages from a backend service to connected clients via Centrifugo channels.
- Broadcast the same message to thousands of channels in a single efficient request using BroadcastRequest.
- Build async event handlers that construct Centrifugo async consumer events using request objects.
- Integrate Centrifugo into a Python web application for server-side push notifications and presence tracking.
- Batch multiple publish or API operations to reduce network latency and improve throughput.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python SDK for communicating with Centrifugo v5 and v6 servers via HTTP API, providing both synchronous and asynchronous clients to publish messages, manage channels, and interact with Centrifugo's server-side features.
Yes, if you are building a Python application that needs to communicate with a Centrifugo v5 or v6 server. The package is production-stable, has low install friction, carries no known vulnerabilities, and supports modern Python versions. The aging maintenance status (251 days since release) is a minor concern but not a blocker if your use case is stable. Verify that Centrifugo is the right real-time messaging backbone for your architecture before committing.
Install
cent on PyPI
pip
pip install centuv
uv add centpoetry
poetry add centInstalling cent
Before you install
Low install friction with a pure-wheel distribution. Maintenance status is aging (251 days since last release), though the package is marked Production/Stable and supports current Python versions through 3.14.
License in practice
Licensed under MIT, a permissive license with minimal restrictions on use, modification, and distribution.
Quickstart
pip install cent
from cent import Client, PublishRequest
client = Client("http://localhost:8000/api", "api_key")
request = PublishRequest(channel="channel", data={"input": "Hello world!"})
result = client.publish(request)
Requires a running Centrifugo server instance and a valid API key; Python >= 3.9 required.
Verify before relying
- Whether the aging maintenance status (251 days) signals active maintenance or dormancy—no commit history provided.
- Performance characteristics of the async client under high concurrency loads.
- Whether Centrifugo PRO API extensions are fully documented or require external reference.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — aiohttp, pydantic, requests, types-requests |
| Maintenance | aging — 251 days since the last release |
| First released | |
| Downloads | 267,405/month — #8,292 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cent-5.2.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
centrifuge-pythonWebSocket real-time client SDK for Centrifugo…
permissive · top 15,000 on PyPI
speechmatics-batchAsync Python client for submitting audio files…
permissive · top 15,000 on PyPI
scale-gpPython client library for the SGP Client REST…
permissive · top 15,000 on PyPI
realtimeA Python client for Supabase Realtime that…
permissive · top 1,000 on PyPI
speechmatics-rtAsync Python client for real-time…
permissive · top 15,000 on PyPI
meilisearch-python-sdkProvides both async and sync Python clients for…
permissive · top 15,000 on PyPI
simple-rest-clientA lightweight HTTP client library for building…
unclear · top 15,000 on PyPI
python-okxUnofficial Python wrapper for the OKX exchange…
permissive · top 15,000 on PyPI
mailjet-restA Python wrapper for the Mailjet Email API that…
permissive · top 5,000 on PyPI
vapi-server-sdkA Python SDK for the Vapi API, providing…
unclear · top 15,000 on PyPI