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.1.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.1-cp314-abi3-win_amd64.whl (395.2 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.1-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.1-cp314-abi3-musllinux_1_2_aarch64.whl (708.7 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.1-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.1-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.1-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.1-cp314-abi3-macosx_11_0_arm64.whl (501.5 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.1-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.1.tar.gz.

File metadata

  • Download URL: cosalette-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8e4cf7507bac73c58d87c8954404277fc56021eefc8990e72273b07a826381d3
MD5 2a9a24b5ef3cb1a45e848536e962bd5f
BLAKE2b-256 2cd91e8737a78aa2816390fb7209e6f68e22bb6bd4c8e6b619c1f185bf2ff589

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.1-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.1-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 29e5d3c36a6b848e5287d0671d2219c13c307a620933c8cd04bbe29817bb01dd
MD5 d5efab1ae9f45d3db7737bbfc370c553
BLAKE2b-256 6203f04fa1b25a1acbdd5db90dd74bd72862f0b57dc57b4abfa96361cf2182f4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 996d89176e7f99ee1b7d80e564b39064f5d174b0971a95b7d50f370dc612d5fa
MD5 026398970bab65cfadfefc97fe326a15
BLAKE2b-256 f5c0483111b66f952f793c87cb9ea8e54fd51233b8b5a8b6101281671ee4233d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5752f0be56c6f22549403d58cd6e87ade5dd029aeac8e5d559ba1aa4b036f95e
MD5 d20eb2dfaceb771d2f65b2c3f0894a61
BLAKE2b-256 e377c52b648b03f1f88a28317a8229995702dc042011c69923b4f2b650ff632a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c260c6fbc6df3ed051cf8cc452e87e2e1b4253ae28625e6d5af3942290fa9ec
MD5 fb478b7490d7337d74712077e37b7739
BLAKE2b-256 8bc92446ecf19f510907ecad36eaf2dd3210a9a9c07b9d1f801d2917c83782eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e39681fb7e89703e638139fc2803aeab3e5317ce83d0710f3868e69b35f95978
MD5 b4bffe24ab9de8cb899a61758e4ae104
BLAKE2b-256 70f08df5b1c325a3c03524f77ca52e638ea3de21d46f28c4124c0a40377b3cd9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d249a2c4d80e017c877c13f3d41cfcf2c2a927f725aaa3aea6e37c4a7ff0712d
MD5 93ea41304e55f5d531836fc9886b71c4
BLAKE2b-256 07d762677c520d003fc02de35b86df36e75701cd5ad0ed9fb259c3e169dc066a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 79d1a4a891f693fae3de6210afcc8b06b43bc5e1b4c89c4ea4877cfc49394700
MD5 344d41be910a94be8b5ba013ff0ee711
BLAKE2b-256 1f8fd03fadbf167ce1e41a53eb23a9a46ec638254c9ce5fd20468680d2f6e382

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.1-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5c66066d98daf4581a6208c7b0fd86f7dd1626d8b677aef60d19f39203219647
MD5 88aa193848d8528d5efab1bbefce2e9d
BLAKE2b-256 7973e80e91558b7ccda85a1dba5dcb73ac5b8e2b83286c9bbe344a73f9760429

See more details on using hashes here.

Provenance

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