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.8.tar.gz (245.4 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.8-cp314-abi3-win_amd64.whl (416.3 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.8-cp314-abi3-musllinux_1_2_x86_64.whl (760.6 kB view details)

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

cosalette-0.3.8-cp314-abi3-musllinux_1_2_aarch64.whl (729.7 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.8-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (557.9 kB view details)

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

cosalette-0.3.8-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (561.3 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.8-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (554.0 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.8-cp314-abi3-macosx_11_0_arm64.whl (520.9 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.8-cp314-abi3-macosx_10_12_x86_64.whl (523.0 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.8.tar.gz
  • Upload date:
  • Size: 245.4 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.8.tar.gz
Algorithm Hash digest
SHA256 2da936b4bac69e46e8c116d483ac7d6e85388e0dfa75153cfdaf12e977cd4f19
MD5 9090146050e13750c100a8cee8dc0447
BLAKE2b-256 f1790552c4d569787b60aea079a6a96d42413958c59946104d5068c4e7408589

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.8-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 416.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.8-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0adfcdbb9163b52aae9c1d915dce31fe0c50a81af847d5dce7350ed4ef3d4041
MD5 4d6706d97d399722bb03c46d72e5f3e8
BLAKE2b-256 32a3d468d128488b63023cc97b20e69c2c9de5f828851b82e421572fa3f631bf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 26dab807c8eee3e8c465f7ebf632c11b92ae6c3cdfafaebca6ffd77f116518a0
MD5 a8e5fabc89a67e5eafd2cc6838ae2cfc
BLAKE2b-256 baefcea40bdf21f06915db63235b1510e7dc0acb7be3466123e4a184666532b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 bb9d71621f40b0fd3b8f8c3aac77561223e6641a025dbea1c589010a4825a123
MD5 1215b281c1da1ea135fa7baf8d095039
BLAKE2b-256 223082a94f5eb2011068eecf99f782a59c83f8b32f50b827ade8eafd72bcae0e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c1e6f1915b66ce4fc9969e5d5a62dfdf0ecd4fca44c1f1dcd71639981133c3c
MD5 a004794a12b665b1d54114f89118216c
BLAKE2b-256 5fe8840bdf7e40db6a1a4617d28cf6ec8771487a5364b6f23b7f02b221789ea9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 02239d41368f296e9b348a657ddca037ae272417c392676171fc0870a57ea540
MD5 717a0bf090c1af80efda8cf9d1a82543
BLAKE2b-256 6d1a93636ec5ac18a974ce2944effb4d4d762b40d07c8f31921138e5aa4d6ca8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 08c02c68c8a33f53a9635b64a4f65d20e6e5dab205c9db0d23898157b1a3ae90
MD5 498315cec1b95e9f91db5f73c65e833e
BLAKE2b-256 bea1c7a3f2fbab662d9e891fef2bb745a2a8073bfd47861410e568f3c0dd0799

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1cf69cbf5772bc75ef62cf94008e33e27c7ae1bd1d144e01ae3baa9c7ee942be
MD5 59d3a937ff4c9709e3c413ad215bfb4d
BLAKE2b-256 bf9366d7ac8a751cc83bc16229c0884b604305b54d407f80baf776ecdd29513e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.8-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9a14b8141bac7a8fc536056570bf75db2fcab2513a48ca6fcc62f1fad4d89862
MD5 4afae09106ff3921878d38a8eaa6e0a6
BLAKE2b-256 fbcb6c56d94a20ded2f7413a2e9446ca5c73d62705c1f24cbaf5f5efa163e3d6

See more details on using hashes here.

Provenance

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