Skip to main content

Async client for Televic CoCon conference API

Project description

release

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 with support
  • 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

cocon_client-0.2.5.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cocon_client-0.2.5-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

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

Hashes for cocon_client-0.2.5.tar.gz
Algorithm Hash digest
SHA256 318cb94dacf6072638b927d91184d118f505a03914f5b043681101403b0a6e9a
MD5 f7451f1b314f96159a15fade89cfc509
BLAKE2b-256 d10e2062c6a78baa5f1d4158e55b0f9ba454f9bccd60673526edbfae3250f35d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cocon_client-0.2.5.tar.gz:

Publisher: release.yml on 3P-Technologies/cocon_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for cocon_client-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 04c630172cf79ed279e2614115ec56779d8b35ead1f990e21a1f715d04cd117d
MD5 ea470106e1d2642588827671657edffa
BLAKE2b-256 65564ffe07d0593d5bf915ee78505d1d0d053b316b83fc68913500c63e0e6d2c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page