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.5.tar.gz (240.9 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.5-cp314-abi3-win_amd64.whl (411.3 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.5-cp314-abi3-musllinux_1_2_x86_64.whl (755.6 kB view details)

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

cosalette-0.3.5-cp314-abi3-musllinux_1_2_aarch64.whl (724.7 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.5-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (552.9 kB view details)

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

cosalette-0.3.5-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (556.3 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.5-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (549.0 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.5-cp314-abi3-macosx_11_0_arm64.whl (517.6 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.5-cp314-abi3-macosx_10_12_x86_64.whl (522.3 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.5.tar.gz
  • Upload date:
  • Size: 240.9 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.5.tar.gz
Algorithm Hash digest
SHA256 876e5e83ecde0ea3b7ab8350fb87759575604863850088f32078453f61eba94d
MD5 72a62865fb22c68d88d290d0e005dde9
BLAKE2b-256 9f9c24dd6600db47839d821f42afd8f9db2040cda0ac0dc7dacc5f1abd529780

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5.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.5-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: cosalette-0.3.5-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 411.3 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.5-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0b5459db34d690b3fe64d7b175f821b1c6daf05ea6576c81880088a82bc766a0
MD5 80c480130b589c473b172d1ee29f594c
BLAKE2b-256 c0a8ff6377f684b7d1e45dd51fe6cdc2426ddb70c31fcf84334f73966be3ca6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ef9db03d0f381b7cc9951f9ecf50885aebf78495d171b9b0ab3450f42b99922e
MD5 76b155f1e7976be762978294bf3a54b0
BLAKE2b-256 4d5243530781dca3633cfbabceb3062d18e51e209224e7cf6c87dc516aa2aa98

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 eb8b36cd54f121d8577d40bd18420bcace90eef4ac822c4d6a01107b7fd72cc3
MD5 2a29a57843abf246c4507dce56430413
BLAKE2b-256 c60e9c9ef1d19c26c5c5c06c215b3958417b02c48f76856fd1062445ed308472

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3167aac6f9633dce970e251bec81a8b9214dbb63ad034cdc3a57a6bd7af6169e
MD5 b778b01d089c7dd7213684a8da08b9e3
BLAKE2b-256 40c5b4de1a4160df2a7f28b86e53a0b81c6e5c30e145e200698be85321681fd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7e56ed737328e51457c3bd66010f2082efc718ca389b522092bc2f120594d7f5
MD5 6ba0fd866420b0a15f5ce0eafa5606e6
BLAKE2b-256 7cf66e6099f8615ee80d92c0b811f2e7249047335390434c2c9c40af3decbca8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bdf2975acc83d8ce1ee4f36026c19b0c6d920778abfdeb40c0605c40ae730b84
MD5 8bb9c506189b2060dc747fd335a504ce
BLAKE2b-256 6afabfc9aef2d95734f36e79f26a10e6e12470b4aa6eb74de85af89956797fc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39c228326b9f21299a5127b7db19235a1d9ee8a656bad499b45c17184dd19279
MD5 5bea424122dcf525e4272aa88c11c051
BLAKE2b-256 ec540952479643371377260d9216a28b62232b3b174acf2defcd5619f34dbada

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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.5-cp314-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.3.5-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dcb1769e6566fdd18b0b4b06adbba2a1cedee0b04bb6ff5cbc8c4e8f60e1a8dc
MD5 983990862a20537513a95dc6a7869a90
BLAKE2b-256 37fcc944b387490e61d021e5a2375c284da5bba92e732d9e8a04b4cce3a1b584

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.3.5-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