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

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.7-cp314-abi3-musllinux_1_2_x86_64.whl (760.6 kB view details)

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

cosalette-0.3.7-cp314-abi3-musllinux_1_2_aarch64.whl (729.7 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.7-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (557.9 kB view details)

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

cosalette-0.3.7-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (561.3 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.7-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (554.0 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.7-cp314-abi3-macosx_11_0_arm64.whl (520.9 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.7-cp314-abi3-macosx_10_12_x86_64.whl (523.0 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.7.tar.gz
  • Upload date:
  • Size: 245.4 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.7.tar.gz
Algorithm Hash digest
SHA256 8302457a5e5a9c8fa0561b4c5c8c3cbf836b770ec7a8592b7a67c3bdf49347bb
MD5 96280ecdf43fcb66447b553c8f8a073b
BLAKE2b-256 328c0dee2c5df23bd8769b9717520940369236ec8593b58072a25e308ab5eaa6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.7-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 416.3 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.7-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6e52540e8706cdef96e4413d489d34e02500b2a25632eaaa9583927d8685e766
MD5 6f738770ef37ce30ba72e22d3dd486a9
BLAKE2b-256 58c8ee56617382e8534d2f2f8652d983ebc02326acdac4b6ff7823b31b913263

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 28ab7eaa086deba292308d1cc8519b119fe5d60c0b412f9b15e33b84cdc73000
MD5 91c5aff01cfdce8ed2fc054171a47bcb
BLAKE2b-256 71df9325321b262534a3c26da1b43f1a4213e1576098404a9f8c9500cabe68df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 021c8fad211d13169647bdd154ef3ee87a2d15b5c05bd4b19947d4e65e8ff8a2
MD5 25ea284ee50ea1fd9363001861b775e5
BLAKE2b-256 665f08d60255061aecad002e6a4d4cc5fac4e79cd1273ced6594475ce8efec67

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d0356372e6612b091c5b07535fc276836c8c88a6289f21acf94c478fcd58666
MD5 3e56af0a153aa3ddc80fb66730bfefd0
BLAKE2b-256 35a02c7eb8168b7c2960089245a2f575cc35b8d8e3595ce51754e328f66f4d04

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 28246e8fc028dc8e37c8df9710ea58560adde820fc77df2f8b82fb01aacf1f21
MD5 283d2e2bca43a696229134b618931f2f
BLAKE2b-256 3b6ffe846a961fe96ea56d856e6aaa33b3f19638a7edd8d19f3251c2911ed513

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5a5858d7b49d1a3494c05563236c803181e18d64de918dbac68a245603e4d1d0
MD5 143472d9cf52bf28f019940c4b3a746a
BLAKE2b-256 113b1466390163ff2adb9f001a624e7313c36ef5e2b6b812428d2ec825a3ddc7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a84dc9e35c16382395dd050ae1a366e71675f90159018feaa27dbdc2d9759d8
MD5 d07c7857902f0e9aea5123e88fd63aaa
BLAKE2b-256 98e72626a299d472bb9edf04d7b937c613d5f6aff346c21b6af54d908e9281b1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.7-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a8528eba6adc1aafad4a92f814c212725690f65f5b4ed277b7d5d8d19c1a0eef
MD5 1869783873aa4b7e73644ad006e68518
BLAKE2b-256 1294ea77b73193d4bf23f0efb7ed67e5be1f94db34dd3f2ec29cadd256fcb730

See more details on using hashes here.

Provenance

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