skillfed

cent

Python library to communicate with Centrifugo server HTTP API

cent v5.2.0 267.4K downloads/30d#8,292 on PyPI
Permissive license MIT AGING released

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 cent

uv

uv add cent

poetry

poetry add cent

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Software DevelopmentTopic :: System :: NetworkingTopic :: TerminalsTopic :: Text ProcessingTopic :: Utilities

Tags

centrifugo http api clientreal-time messaging python sdkcentrifugo python libraryasync http client centrifugopublish to centrifugo channelscentrifugo server integrationbroadcast batch requests centrifugo
real-time-messagingcentrifugo-integrationasync-http-client

More Software Development packages