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.9.tar.gz (245.5 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.9-cp314-abi3-win_amd64.whl (416.4 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.9-cp314-abi3-musllinux_1_2_x86_64.whl (760.7 kB view details)

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

cosalette-0.3.9-cp314-abi3-musllinux_1_2_aarch64.whl (729.8 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.9-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (558.0 kB view details)

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

cosalette-0.3.9-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (561.4 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.9-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (554.2 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.9-cp314-abi3-macosx_11_0_arm64.whl (521.0 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.9-cp314-abi3-macosx_10_12_x86_64.whl (523.1 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.9.tar.gz
  • Upload date:
  • Size: 245.5 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.9.tar.gz
Algorithm Hash digest
SHA256 9586c57d94b145edb11d1f85a017f717422d2de56d3164a3093072a7f52e0c98
MD5 d2d93fa4d1f83954205531023ca86e7f
BLAKE2b-256 20fe423d292b01730b84a80d1e6d7bd51a677a00e7433bf163aa2998d7cbdf73

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.9-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 416.4 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.9-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 59cb1bc6eb662d932915951f32b160aed993f1758bdeae5f143f14152b7e590b
MD5 4a85c6452721b21e553bd74d30201daf
BLAKE2b-256 0479dd463a54a48f05774c025d1ce9ed2cf0bd84a9f129ed5d81746d1a72b7c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 36183ffdd95f02520391595828d288d2e13815416d755a4b87a485cd76fb1c8e
MD5 23705c4bb7e168c7ab0f2d36c05a0309
BLAKE2b-256 b6eee67180f40a3ab6eedc7367c9f6015ca03e8bd9f07882ce6ba03520b6ad24

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8d49f401313a1cf898862b6d2db43b9de70ed4d62dc664403df2d6771611efcc
MD5 6b132bb655b81fa09679f11f39ec9dba
BLAKE2b-256 18e8fad5fc309d3f9dcae919ccf9b71def574fc6005368c7bcf73e456b26dbb3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 031e7a6ea8365220548652dca02fa822ebdc11044fcc468d529b2768e8b60d55
MD5 aa3163cda35eca7016230a570eb23862
BLAKE2b-256 a2507ac59023fe59a05d0b9693b6c9d14e86689771c56a2b2b4467b6d6f75175

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 6650194a64e3c6ad7738fe041338517d79a9e343b0c8347e748f9fd044f99b5c
MD5 20525317610ace42d295b2753dd7e00c
BLAKE2b-256 6345f4ecf780c81a0e1e2f2429eb17813cb112e8dfa62cd4e66ad29cc6bc713f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c50d697f86801065873e9a54e8e0ba31c7d1108371e9bb9edda00bd94b68d2e9
MD5 86a43f61d2caf8810f431d4d3218950b
BLAKE2b-256 8b2f4ba3033f84400536b0b81bedeeb366d23e954aa0a476603c2d8ea86ea459

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76dd206130a21c64a0110908a80ff937f4f803cc768c96e0e18a19df4fbae71c
MD5 0c9963dc0aea6cdf672dbe5b3b46cbd3
BLAKE2b-256 842e24c05fdce17789785e58d5bdd33957b6a894616b3a50d8a82eb8e6feb88b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.9-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a30addd6a4e0fd50b8645c0abf9f9b862f92f9a47aa8fb91e83b6ed4793071ba
MD5 6703ae3055ed3d9c05835fc7b1d900dc
BLAKE2b-256 d93a65cdc8892660b55aece0a63397012a47a9bcd950f4ecf85f802a6a008485

See more details on using hashes here.

Provenance

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