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.10.tar.gz (246.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.10-cp314-abi3-win_amd64.whl (417.6 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.10-cp314-abi3-musllinux_1_2_x86_64.whl (761.9 kB view details)

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

cosalette-0.3.10-cp314-abi3-musllinux_1_2_aarch64.whl (731.0 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.10-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (559.2 kB view details)

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

cosalette-0.3.10-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (562.6 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.10-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (555.3 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.10-cp314-abi3-macosx_11_0_arm64.whl (522.2 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.10-cp314-abi3-macosx_10_12_x86_64.whl (524.3 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.10.tar.gz
  • Upload date:
  • Size: 246.8 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.10.tar.gz
Algorithm Hash digest
SHA256 72dde72a2d87ca2a593328fdc2aea3d83d6c4c5ec3179219d7ca71777ef95df1
MD5 4d2261120580f0173d40e8a7466fcb3a
BLAKE2b-256 487feadc4356886cafe7a783bf985a2090df578dbff33bb65baaa92aaaa5003f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.10-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 417.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.10-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 68fe617af0cf10a22d85d06042f60ab5313868b8756678a67a748c408f935601
MD5 4dec2b096905fabe6d02a438ae88c19a
BLAKE2b-256 2ecac2bc63f44077345154ede3ea706650af3e3e5349932a66b778180a255837

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cc32b10ea6fcc9f70607784d0f1ad502ba0460a27f567b19a3cae1653106bce1
MD5 5a46d1d9ca1ee38c8ef339ad1f5bec54
BLAKE2b-256 577e66c9d14e4a80d6f5f89eb11d7cc2434357892bc417ee56c2365044951da2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a3558cdc23e648046a10c836e1448dbe94ea45cb04d9828ec7ea930e57bc6979
MD5 bcf8a757cd29030e76c54821b4f26269
BLAKE2b-256 76bff59a155762a227a7af060baa5aa8ec9b022ad17e9bd28d862e583790b1c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 77e055e72dc8381e619bed3e8682eb2f907ccd1ef80920e210d478bca4a2c6b5
MD5 474c2746233273bf411126dccee7ca37
BLAKE2b-256 f2aa80e091877c038604ba0b59ae6bae95f19b21c0424abaab5a2f4b10491b7b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 cd7676aac01e0024792ef55dbb4ea1279091ca64b3b0437354c50abe051375fb
MD5 41d281fe15c70879298d3da3a6fff68b
BLAKE2b-256 7dacee68dd7ccd9c30098409dd5c7fc67459b83de43936f83e677ca4c03fb662

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a211193ade67e140d39a9a8cda9eb149a002f42f0d238750bf16e312143702fc
MD5 fbba80abb805a08a642920ff6f21f31a
BLAKE2b-256 a8a58ed9b123ee61520f0fee70b33fca63b68a5c2342f1a3caaec405b2149444

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4d21ddc30710bbf5502d685c449431ace3f3495e573c0742f226029a01a2bbf
MD5 aede4f8f3b79c9e0319e45e8841a6445
BLAKE2b-256 614e2e8834b0170f37641fd1c6e60bb2035e85829b293188fa94c76725b60544

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.10-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ae2b89157fb1a1cb1cef1c8d3ff08e0e5f4710f32c06f475c6277df0e15bfb9a
MD5 ee3d700296651692685dc233562159b5
BLAKE2b-256 7d03d8e7c6df797e6fb61f58acd614030c4454d6b3a95e8a2e71775a18554d4e

See more details on using hashes here.

Provenance

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