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.0.tar.gz (226.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.0-cp314-abi3-win_amd64.whl (395.2 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.0-cp314-abi3-musllinux_1_2_x86_64.whl (739.5 kB view details)

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

cosalette-0.3.0-cp314-abi3-musllinux_1_2_aarch64.whl (708.7 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.0-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (536.8 kB view details)

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

cosalette-0.3.0-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (540.3 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.0-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (533.0 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.0-cp314-abi3-macosx_11_0_arm64.whl (501.5 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.0-cp314-abi3-macosx_10_12_x86_64.whl (506.2 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.0.tar.gz
  • Upload date:
  • Size: 226.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.0.tar.gz
Algorithm Hash digest
SHA256 bafa7569d7b7945ae873ef663905d6a120ce8ed761d0ef65dad4aee34a0e6fb0
MD5 6dc94d42bfaddba3a135aa5668ed759b
BLAKE2b-256 0fcf687e5e9c4e8baf5115dfd2f81c4fbf82ffd760b5d3837bb7e31a97595283

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.0-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 395.2 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.0-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3f3adba5f2a2adc8f2e054e2ff76a3dc284c98f6485d6ec44bb3cd955ae63f6a
MD5 9b6fc74382b7d0da39849c965d791b69
BLAKE2b-256 13ca235974d5293cef710596bd44514492738743f3f710727d6eff446e08446a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7aa59f156be52c362e1a351a18ecc717f5fc435616590a2913f6e2951b8031d5
MD5 4f20f6a0a3b5c205b9ed6c17a2609e41
BLAKE2b-256 0fc20a2e1a431071e101620c3dce4d90a54cc84682a9baaef2b8ba65e13ccb80

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1f8b23156ce1fa09522361a378a110c0beae10fd7d83267b20d7c5fb77b62844
MD5 0b2720010850707a2d8c932999159794
BLAKE2b-256 92f505a7b4bf4f3f70c0d6b4f30e0f90074cbf5851ccedc370b3b4913ced1d6c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b2d8481174c0a15451c25af4501b2b738a7ffae258a126f27184698b3232d107
MD5 eb42f7a22dcb8acecc012f3980a714db
BLAKE2b-256 d0c5c48bd7af95ad0c26638ceee270a37369861b34a9598f89f1b353cc9006f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 eda14cc178d74a109a0dfde9711dda9dc2a81629236b57e49d4c3dae4db4d89d
MD5 f8c082c63d1d53973e12957fec2f773b
BLAKE2b-256 86085b946c6de44e66eef92dd5996f6252d58e4ed928b0c376e315355bacd33f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 12ded61e58c0f43bd8e02b4633c5b771715239a45dda1c7a54336e34737c93b2
MD5 195ac179b65d46a6c4524df7120bf05f
BLAKE2b-256 dd9bba806394c598b497538e0ffd36bfb6ef3cc27104b27eff8cc769f47d7ec8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f13644b0a0dd72294bb4b27806bb458917a17cede6da812ff56f831e4707a62f
MD5 d2ec7c95903cca9d60b055a7df04d410
BLAKE2b-256 4a6645ae0bd98403dc64cc50d9d8b46430808ddd1feabd51c4d5820edcfb8a35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.0-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0de577fcccc0569166e25282cda045662bd2381e8b3577a24cc2d853889538a1
MD5 1fb18b59ddee719e47fe7b613e7119bd
BLAKE2b-256 1bccf9fafa29857599f30eb44914de46d330eed9a2203183d178332dcf861e6e

See more details on using hashes here.

Provenance

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