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

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.3-cp314-abi3-musllinux_1_2_x86_64.whl (749.8 kB view details)

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

cosalette-0.3.3-cp314-abi3-musllinux_1_2_aarch64.whl (718.9 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.3-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (547.1 kB view details)

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

cosalette-0.3.3-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (550.5 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.3-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (543.2 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.3-cp314-abi3-macosx_11_0_arm64.whl (511.8 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.3-cp314-abi3-macosx_10_12_x86_64.whl (516.5 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.3.tar.gz
  • Upload date:
  • Size: 235.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.3.tar.gz
Algorithm Hash digest
SHA256 d3175e54f5eda7f4db95711b9c686c6dfb69844bf5334ec024e5091f50d00e9c
MD5 a7fc04cddec6fd8f395bad2826a247e1
BLAKE2b-256 7ed432075f54a98e3c67abb24e26d49e13df08e28840d260ffceea3be7026dd7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.3-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 405.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.3-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2e7e97763e29168e97a61036d1bd6a2d743a5c6faaab64bcc9d815632878b292
MD5 4226611f7003a8e7142ae47c912de30f
BLAKE2b-256 8b69b7ce14766a0dba8dcffa44f360cbbc907d4882f28d6c1deb8ace69889755

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 205d8f9c1b5e6612979ef4e4bfa3cd56f7ba805b4a92dc392d8466e2e8b2581b
MD5 9b7384ac6e5ff7d81f2b24984d72fe88
BLAKE2b-256 3e4ec6d92729fa6815ee0be03780e8ee3b7a91aabdf1db51ddd7b7af6f42a29f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d4dddb2692e18f87a9bb69864bd7140042fbd98de1ae90a55c823cd77cc2f500
MD5 67dab6af89fa177676035a0b3359edd3
BLAKE2b-256 37a4b8c9186fef4693f0bdec6be9776c6969c04497dc2bf90ca2ad6e2d26e6ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 39ba17fec1073ee8b71024f2d145b29e697aea8ae6fa5fe1aae400cadfe5b667
MD5 7507600e27aaec3007f428c7072c5cb6
BLAKE2b-256 9818146d86861c348618e12d52df4384da2791493085ec2c1517e5f3885b9f62

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 46adcfd8825db6be302deb9203099ebdfd6667bcae227fed7946daa1bec1d4f4
MD5 bd9b0914d2b480ca2fecc4fc06ca5c41
BLAKE2b-256 9a597bbbbbadb9d8ca0e1776694e28eda84e3c0b8feaa783bc17954a840f284b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f62e9de5df53baaeba35f00900633c1a1a35fb82ef683458c111f63225a1a9c1
MD5 64dd6e2b8cb55117c9842f45ca859766
BLAKE2b-256 2efb31fde6e04fc19425657859a19387a178b8107a222f2c5a7c8080c69fac20

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46493c217796faa56fb5d8c740896e93846005dd8a865eb0fee43fdc39e28f02
MD5 0dbffc47656e7f1592c0f6d2c8615113
BLAKE2b-256 f0a6665b4d149589ac6bd8c8ca18572b9333dc30c909dee961b9e9faa82a8777

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.3-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 60d0df1be1cebbca001cc2e48b73a34a7796a3574b7fb6290f33bf65d9f21edb
MD5 e363d797d617259ef8b4313918947ef1
BLAKE2b-256 a629ad5c552eeaa7b9c5cc7de476a2746f6ac21ad06fe68db3225fb14a2545a9

See more details on using hashes here.

Provenance

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