Skip to main content

an opinionated Python framework for building IoT-to-MQTT bridge applications

Project description

cosalette

cosalette — An opinionated Python framework for IoT-to-MQTT bridges

What is cosalette?

cosalette lets you build IoT-to-MQTT bridge daemons in Python with minimal boilerplate. You define devices (telemetry pollers or command handlers), register hardware adapters, and the framework handles MQTT wiring, structured logging, health reporting, error publishing, and graceful lifecycle management.

Quick Example

import cosalette

app = cosalette.App(name="sensor2mqtt", version="0.1.0")

@app.telemetry("sensor", interval=5.0)
async def sensor() -> dict[str, object]:
    return {"temperature": 21.5, "humidity": 55.0}

if __name__ == "__main__":
    app.run()

See the full Quickstart for a complete walkthrough.

Key Features

  • Declarative device registration — define telemetry and command devices with @app.telemetry(), @app.command(), and @app.device() (guide)
  • Hexagonal architecture — protocol-based ports keep hardware adapters swappable and testable (concept)
  • Lifespan + dependency injection — structured startup/teardown and type-based DI for adapters, settings, and shared state (guide)
  • Command routing — use sub-topic handlers and ctx.commands() for clean control flows (guide)
  • Flexible scheduling — combine fixed intervals, Quartz cron, and ctx.sleep_until() wall-clock timing
  • Publish strategies — emit on change, on cadence, or with composed rules (concept)
  • Health checks + auto-restart — monitor adapters and recover from wedged hardware automatically (concept)
  • Persistence — store state with JSON, SQLite, or in-memory backends plus save policies (concept)
  • Schema-aware integrations — validate payloads and generate consumer artifacts from AsyncAPI schemas (guide)
  • AI-assisted development — optional MCP tools plus packaged instructions for Copilot and other IDE-native agents (guide)

Installation

pip install cosalette

Or with uv:

uv add cosalette

To include the optional MCP server for IDE-native AI agent integration (VS Code Copilot, Cursor, Windsurf, Claude Code):

uv add 'cosalette[mcp]'
pip install 'cosalette[mcp]'

See the MCP Server guide for setup and tool reference.

Contributing

See CONTRIBUTING.md for development setup, commands, project structure, and code quality standards.

Documentation

Full documentation is published at ff-fab.github.io/cosalette. Development docs tracking the main branch are available at Dev Docs (latest).

Section What you'll find
Getting Started Installation, quickstart tutorial
Concepts Architecture, lifecycle, health checks, filters, persistence
How-To Guides Telemetry, commands, adapters, lifespan DI, schema, testing, MCP
Reference API docs, CLI options, payload schemas
ADRs Architecture Decision Records

License

MIT License. See LICENSE for details.

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

cosalette-0.3.11.tar.gz (247.6 kB view details)

Uploaded Source

Built Distributions

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

cosalette-0.3.11-cp314-abi3-win_amd64.whl (418.5 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.11-cp314-abi3-musllinux_1_2_x86_64.whl (762.7 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ x86-64

cosalette-0.3.11-cp314-abi3-musllinux_1_2_aarch64.whl (731.9 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.11-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (560.0 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ x86-64

cosalette-0.3.11-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (563.5 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.11-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (556.2 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.11-cp314-abi3-macosx_11_0_arm64.whl (523.1 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.11-cp314-abi3-macosx_10_12_x86_64.whl (525.2 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

Details for the file cosalette-0.3.11.tar.gz.

File metadata

  • Download URL: cosalette-0.3.11.tar.gz
  • Upload date:
  • Size: 247.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cosalette-0.3.11.tar.gz
Algorithm Hash digest
SHA256 9c9c3779743e398b8855195c1064077e168369aa2c6e421327f0ec8a88dd3412
MD5 219a0e01ae34af2ebddc6ac47fdf13ca
BLAKE2b-256 12cc805f308b74c4fea6ad0da38ec3407ebca27651b0b8259acd3c0692d94e78

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11.tar.gz:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: cosalette-0.3.11-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 418.5 kB
  • Tags: CPython 3.14+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b436806d1fbc18bc04769420c44067feaba3b6da81090080ae1e8e5b1284b474
MD5 2e5ef359973aa30f5b6929b3cfd95dd6
BLAKE2b-256 0268ada2cb5ea31fc0726f49341213b7a6453b62a992af69bac79775064e81c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-win_amd64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 be23351b97787e97ad318918b2623434d3547b6fd0fb5cb1b6d1496885a76078
MD5 b77bca2059c301e19dd2bf7bbde83b20
BLAKE2b-256 5bc45262f7413a0e94607a95c9a4ec554a6ad41dff3414efd355598cc7d8605c

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-musllinux_1_2_x86_64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4ba09bd3c8b2e48307577234d787a0fc97f7c3fd3e7b62c2c6351a76f40d030d
MD5 f3f02c2905afb770f03a4878813f2c16
BLAKE2b-256 b704c7849adfa1866a564b2c67fe6df44f48d1369860c58a48f15b89f3e94c97

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-musllinux_1_2_aarch64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3b852d925441f1994a1732a333c7a6b4765b4526955e874d5d533f9a08db84a
MD5 5c51cb71fe8c2fbe36f2589a9153f810
BLAKE2b-256 56c9d70b7b724554f3d3f954d7e966d22460982886022d45645d76155b772bfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 320910bb7dba1a30400b470fe6774a3ded581fcc9a9fdefb6864a0c037031025
MD5 04e7dc3f7460f51c385bd355271c0c02
BLAKE2b-256 c68021f37f2ef9158d10755409cbde4c1b0e96e16d2925de018bd4a7883b791a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4dcf02a5b3381c91d9a8cc551b81f7605069de4cab885b9eb4cca4cd50d6c66d
MD5 e9bfa458e03779c318c130c57dba50b3
BLAKE2b-256 6822894c90b2926855aa8398c8491de21d82ba33c9766127a80817e48195247a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a48a718cb360cfffd774989e19ddd7353e42f5b3e50fd7d57c7e2ca026070c3
MD5 821a21f44a2f39d9f3a1e355efb848b1
BLAKE2b-256 7aee7a828dee4ff61595dfe066b617f3fdae910ec35a85864d9bac1ebaa35f6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-macosx_11_0_arm64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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

File details

Details for the file cosalette-0.3.11-cp314-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.11-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 deec74b32270c9507c5e6b128c0d10e1b1e7c03f45ef38913b0f40fea05d0aa1
MD5 341983a59363a5481236b0e8dc435a98
BLAKE2b-256 4423c2c1a79b59e10bc9e1a28a4574a1c92f298dd7269cf2caec82122338e812

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.11-cp314-abi3-macosx_10_12_x86_64.whl:

Publisher: release-please.yml on ff-fab/cosalette

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