Async client for Televic CoCon conference API
Project description
Televic CoCon Client
An asynchronous Python client for interacting with the Televic CoCon REST API.
This library provides a type-safe interface for communicating with a Televic CoCon server. It supports long-polling for event notifications, command dispatching with automatic retries and clean shutdown of background tasks.
✨ Features
- Async-friendly with
async withsupport - Long-polling notification handling
- Automatic command retries with exponential backoff
- Configurable behaviour (timeouts, polling interval, retries)
- Typed and documented public API
- Minimal external dependencies
📦 Installation
The project requires Python 3.11+.
pip install cocon_client
To work on the library locally:
git clone https://github.com/MarcoMiano/cocon_client.git
cd cocon_client
pip install -e .
🚀 Usage
Creating a client and subscribing to models
import asyncio
from cocon_client import CoConClient, Model
async def handle_notification(data: dict) -> None:
print("Received:", data)
async def main() -> None:
async with CoConClient("192.168.1.100", handler=handle_notification) as client:
await client.subscribe([Model.DELEGATE, Model.MICROPHONE])
await asyncio.sleep(10)
asyncio.run(main())
Sending commands
Commands are queued and retried automatically:
response = await client.send("SomeCommand", {"param": "value"})
Parsing raw notifications
The helper parse_notification converts raw payloads into typed data classes
defined in parser.py:
from cocon_client import parse_notification, Delegates
async def handle_notification(data: dict) -> None:
model = parse_notification(data)
if isinstance(model, Delegates):
print("Delegates:", model.delegates)
⚙️ Configuration
You can override default behaviour using the Config dataclass:
from cocon_client import Config, CoConClient
custom_config = Config(
poll_interval=2.0,
max_retries=10,
session_timeout=10.0,
)
client = CoConClient("host", config=custom_config)
🧰 Contributing
See CONTRIBUTING.md for guidelines on how to report issues,
submit patches, and extend the parser with new models.
By contributing, you agree to the dual-licensing model (LGPL-3.0-or-later or
Commercial) described in the contributing guidelines.
📄 License
This project is dual-licensed:
-
Open Source License:
GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later).
See LICENSE for the full license text. -
Commercial License:
Available for organizations that cannot, or prefer not to, comply with LGPL terms. This option allows use in closed-source projects under custom terms.
Contact 3P Technologies S.r.l. at contact@trepi.it / www.trepi.it for details.
Disclaimer
See NOTICE.md for disclaimers regarding Televic CoCon.
🛠 Maintainers
Developed and maintained by 3P Technologies Srl.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cocon_client-0.2.5.tar.gz.
File metadata
- Download URL: cocon_client-0.2.5.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
318cb94dacf6072638b927d91184d118f505a03914f5b043681101403b0a6e9a
|
|
| MD5 |
f7451f1b314f96159a15fade89cfc509
|
|
| BLAKE2b-256 |
d10e2062c6a78baa5f1d4158e55b0f9ba454f9bccd60673526edbfae3250f35d
|
Provenance
The following attestation bundles were made for cocon_client-0.2.5.tar.gz:
Publisher:
release.yml on 3P-Technologies/cocon_client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cocon_client-0.2.5.tar.gz -
Subject digest:
318cb94dacf6072638b927d91184d118f505a03914f5b043681101403b0a6e9a - Sigstore transparency entry: 495424696
- Sigstore integration time:
-
Permalink:
3P-Technologies/cocon_client@2d01c6d82fc2f122064bacb21aa70c62c5524165 -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/3P-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d01c6d82fc2f122064bacb21aa70c62c5524165 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cocon_client-0.2.5-py3-none-any.whl.
File metadata
- Download URL: cocon_client-0.2.5-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04c630172cf79ed279e2614115ec56779d8b35ead1f990e21a1f715d04cd117d
|
|
| MD5 |
ea470106e1d2642588827671657edffa
|
|
| BLAKE2b-256 |
65564ffe07d0593d5bf915ee78505d1d0d053b316b83fc68913500c63e0e6d2c
|
Provenance
The following attestation bundles were made for cocon_client-0.2.5-py3-none-any.whl:
Publisher:
release.yml on 3P-Technologies/cocon_client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cocon_client-0.2.5-py3-none-any.whl -
Subject digest:
04c630172cf79ed279e2614115ec56779d8b35ead1f990e21a1f715d04cd117d - Sigstore transparency entry: 495424722
- Sigstore integration time:
-
Permalink:
3P-Technologies/cocon_client@2d01c6d82fc2f122064bacb21aa70c62c5524165 -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/3P-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d01c6d82fc2f122064bacb21aa70c62c5524165 -
Trigger Event:
push
-
Statement type: