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.12.tar.gz (248.7 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.12-cp314-abi3-win_amd64.whl (419.6 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.12-cp314-abi3-musllinux_1_2_x86_64.whl (763.9 kB view details)

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

cosalette-0.3.12-cp314-abi3-musllinux_1_2_aarch64.whl (733.0 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.12-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (561.2 kB view details)

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

cosalette-0.3.12-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (564.6 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.12-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (557.3 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.12-cp314-abi3-macosx_11_0_arm64.whl (524.2 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.12-cp314-abi3-macosx_10_12_x86_64.whl (526.3 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.12.tar.gz
  • Upload date:
  • Size: 248.7 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.12.tar.gz
Algorithm Hash digest
SHA256 bca7f7503b9eb6b887a2047079845464e67b58a5d09e69cf132f4c9f0f253cf1
MD5 f46c6d21d6a8d2e052df46e621334962
BLAKE2b-256 b9b0b94a15a54088b143d3d6bf762de1ed914421bd736c559deb0762e33ea67b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.12-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 419.6 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.12-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5b9f31f58ef6475f04c3620eee98875b40182a8a0fa5c2354291bc08839632fa
MD5 76a1e251952351be1fd9f7431233985c
BLAKE2b-256 4e59d2086604d802f897030c41fe4446680025d0a80837ae23c1b137c0007c74

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5ce6456bc6ecb8ec151cbcb4e14190d773a7d58848952b06cfae4cbd60c8d1ff
MD5 8523103a1fa63269ad2a966bf07cba6c
BLAKE2b-256 53de88c0561d460f71a72e1d64bd5373198b312a7624f00d265de2bb0f569642

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ed1ee40107e32128f3bd23652e818f36fafb4a38c2bcd16996715ad449a2eb5b
MD5 0f154b4fa2fb5eb4a5c850f4028d0c81
BLAKE2b-256 0e3fcb530c9e27f21fcc0ad832cfa9180bff9b32f6b51cbc4d5213e59fe0bee9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d4040341f7c34cbff99c2e0f065111d986231ed4bf233581c4256639468f9d9
MD5 423cd4fd066d738e0a8e8955c51284f1
BLAKE2b-256 ca9001e1c8a2b49e26ca19e1998f8b607d5e6ba4fa752446124389c6a384d0f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 9b0279ac51c586fecc6d4557a491f0fd6cacb2823c0b0dd02882c08b2fa14f06
MD5 c90fa63a6899570a14f74dc638dabc04
BLAKE2b-256 69f90d8bb50a6775f84f11b79902bd13d241f29e7d4415fa42fd4c82dbdd1ac1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ba5f8d4857037dfde311f863982e472026d451ddc88f43e705410720f361ad74
MD5 b25442c111bb487af733afd400f78365
BLAKE2b-256 e41953e63206fa7773756b02d8c0b02590420632023fe243378f871b65b9da2a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e755752f903f52e224720f320bdd5a9ad015644064178dba7f2faa6238a93eca
MD5 e7e2148b28a2667f667953ee62a9c893
BLAKE2b-256 5121ddcf78254f56355dc38c692dac4b8ec53c55dfde49fa435bb91cf7d2ec77

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.12-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 212969a9b617f11b89248b6448e550beeebbac8ddc23f4c3c5fb599c498c85d2
MD5 36b2bd245902b173ec3660bc397fe311
BLAKE2b-256 57c026e70ece001bf1d1d584fb0062ced22e3de59d8d048f63441ccefca47290

See more details on using hashes here.

Provenance

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