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.13.tar.gz (286.8 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.13-cp314-abi3-win_amd64.whl (485.4 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.13-cp314-abi3-musllinux_1_2_x86_64.whl (829.7 kB view details)

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

cosalette-0.3.13-cp314-abi3-musllinux_1_2_aarch64.whl (798.9 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.13-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (627.0 kB view details)

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

cosalette-0.3.13-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (630.5 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.13-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (623.2 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.13-cp314-abi3-macosx_11_0_arm64.whl (590.1 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.13-cp314-abi3-macosx_10_12_x86_64.whl (592.1 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.13.tar.gz
  • Upload date:
  • Size: 286.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for cosalette-0.3.13.tar.gz
Algorithm Hash digest
SHA256 01f8ff4606242f1ef8fbd5b31e76be49fd61adb0b6300c7a9add793646b62148
MD5 282ed99ab9823549c6793a9cbdc44893
BLAKE2b-256 91713db9697d3c7ee6b6aaab233085cf36801dc87e37a67d9d9081bd17365758

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.13-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 485.4 kB
  • Tags: CPython 3.14+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 08490efc8fca793c132eb1d8beb5edda512109bc7940e687469927d21002254e
MD5 95287ea444411c0ba546ed6047e438fd
BLAKE2b-256 e6cc0d5ff7711db5a2e97585bc279a7ae70159d5c98dffe8eacc5a132bda173d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 351773c2d1780df872b72791b6a298cf3d4f926868e023cef934c1874a044924
MD5 f2bbac9672a20efa0306ff479fe7b9fb
BLAKE2b-256 efbc8dbb0ccf69e969458e720b9ad3c869f1bea58f8e3fe0bbc315a1737056f1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 17b2fc8061e810564d6634f3b24b85f5fecc90ba02c2e4efc2bf500c2f837e97
MD5 be2c7b87dd9b321f91bd94d35fd20170
BLAKE2b-256 3316bd6c42c1676fa36a2be295aeca244e0c71e52fd83b242bca0dc18cd3e72f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a55d276935ec9a4218d333b87417e0e202470103b742af6d9441bfda776f4bd9
MD5 4d602585d7a52ce2b92e1fd13c6696eb
BLAKE2b-256 03fdcaec1b1f6f593adbb03cc80409fcddb53d165c25ac95a596a97e51ed0f3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2557fbc580a510c215d0f39c435cd49e6606aaac3d15be09c132030eb3c22a3a
MD5 69e8bf928b7f349c98c6a6d184403ab1
BLAKE2b-256 4854836b6d67dc54c7a20d9435f32b12578d7e7134b18506cbbc05b16ac8f91d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5c1bacb8803436257f4b7a2e041350dd1b7fe3c7858c83e8a85d06c896852380
MD5 cee5809edb106672590239b06469b3b7
BLAKE2b-256 d06c6eb7fe8372b4aaccdf74fac0ee6b26cd667797ad67cb3812dd6137ef9f47

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20980d6857640ad18b2bb0bc769246ab72cbb7fd244673532e5e8863da96a426
MD5 7f4f4c5a6b36892603af123cc52a5aa2
BLAKE2b-256 46fca6e88f0a8f3740fa97ae115fc9652c5b8304b5d43b5151e08a990e8fd551

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.13-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 554cc01b6cff915003e96d2d6fcbf3093988856f4da81d0773f56553cf15357c
MD5 82ec08256f7c885f82089e18664190e7
BLAKE2b-256 a0a9a1013ea2d16089af1a732485c6e1f153c3ad8318c378b5240734408d71a2

See more details on using hashes here.

Provenance

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