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.2.tar.gz (231.6 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.2-cp314-abi3-win_amd64.whl (400.5 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.2-cp314-abi3-musllinux_1_2_x86_64.whl (744.8 kB view details)

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

cosalette-0.3.2-cp314-abi3-musllinux_1_2_aarch64.whl (713.9 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.2-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (542.1 kB view details)

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

cosalette-0.3.2-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (545.5 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.2-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (538.2 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.2-cp314-abi3-macosx_11_0_arm64.whl (506.8 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.2-cp314-abi3-macosx_10_12_x86_64.whl (511.5 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.2.tar.gz
  • Upload date:
  • Size: 231.6 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.2.tar.gz
Algorithm Hash digest
SHA256 27046d0e0c006f2d241f4f867ccfde1cb7b899ec6a7db0e5f8ec91d080f8464a
MD5 b25e7c05811f25c91e443772190d0579
BLAKE2b-256 3f7789af4e1da17eca9df586336b691926cd889aca2ee74387c0754bd3463a26

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.2-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 400.5 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.2-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 76d1a8b7b6f0d30284ba425eec9bb298e3a457098307d4af4b32460bd992d7a4
MD5 a2e8fa1339bc45f85d2a4ee71536a3f9
BLAKE2b-256 3b4c1b8c3e36d46c7b7edb74588c1564b7be9b75c9db33974a1ab047fb935ac7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a3dc6e6a0fc9eec54f6b2d09c7976aa1a4629101c4a6016d1bea9940a62242c4
MD5 9bbf8782212a84e54e1d056e42c2fd5c
BLAKE2b-256 f64adb8e9d8746b7e8725248e60b9874f25d9c53860e93fea425465f1ec14fcd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f7ececc88e88798b4469b81a9e26442855ca4c47781476e3d65ee3bb5af585cd
MD5 986953e5f0a87ae4e82a6603c9c34853
BLAKE2b-256 510cfd1accdf43c391be2a23fbcff4dbde6189ecc523ecd9771f43a45c1a632b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2dcbbceeb9ab1611c21d08230905d11c1d3a48f8a3a899cc364291c70b4d2c3b
MD5 0e492db5ebd0ec0a1df98b457e172b95
BLAKE2b-256 9e5004d970f32458d83509d0e8cacac7023cb1b3aecfc77c5b3180b011d64d53

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 aa8cd4c9274129d85bf833a6e3c37662fdbfb05fa52b0071e495ce8abf441021
MD5 083192206081f28af367f3b349b4b557
BLAKE2b-256 2b0688eefac0a10e872fd81410c7ca181397d8fb7c63e97826d7316746a59e13

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50e6fe4332d3f49ab346f399d78bcef69d9b99d70501c118e283c1d72217ba51
MD5 632e6cc127ffb7ba9b3308995f37ab2f
BLAKE2b-256 fa8dc25f24929f09eece0da587693ba3ff7073d6d524bfd6af3938e9711d0e09

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96c689020aebd41fcc227e8eb87a268da6b2bf30f428b9fa064ccd4aa08395ba
MD5 b3fb7dc032e96d75fce2189fa7651119
BLAKE2b-256 37fe05b016f6200c5e01180ab4e268c9d5419af8c30b48cb8f06dcae17fad0ee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.2-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e663f68692d4cd7095dbb896e141e26975b751bb0625824c9b2a8dce2b5bf0b3
MD5 257bd354ee56817df361537aba9c5afa
BLAKE2b-256 ef7730062f57888f75669ab9389b96ce950c325557691aa592264d3851cd8a4f

See more details on using hashes here.

Provenance

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