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

Uploaded CPython 3.14+Windows x86-64

cosalette-0.3.6-cp314-abi3-musllinux_1_2_x86_64.whl (760.0 kB view details)

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

cosalette-0.3.6-cp314-abi3-musllinux_1_2_aarch64.whl (729.1 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.3.6-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (557.3 kB view details)

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

cosalette-0.3.6-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (560.7 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.3.6-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (553.4 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.3.6-cp314-abi3-macosx_11_0_arm64.whl (522.0 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.3.6-cp314-abi3-macosx_10_12_x86_64.whl (526.7 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.3.6.tar.gz
  • Upload date:
  • Size: 244.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.6.tar.gz
Algorithm Hash digest
SHA256 d2d806a1985c1fc74ebb5e846b67dc398b3ac0fcfff163ef33c60061315bf8f0
MD5 ea7dcb7c312909703be4759dd54006b7
BLAKE2b-256 14a74d1605e7990842f4c0f619823721de27fbceaaa64bd3dc6e254f10d0cae4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.3.6-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 415.4 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.6-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 aebe4361bb9cd4cafbb980630fa56baaf5d4957c22e0a36f4c5240a04a17f65f
MD5 4bf2ec2656bd9ed81b7ef08e04b1aad7
BLAKE2b-256 f939e50800f6f8dbded65a487fb19bca0fc42f23014770e485e5754eb1953c6e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 54964f0e6410d825ce60200108d4ea7cddaf84ae82feebf7267effe462bdd277
MD5 bef4ec616df1efd2b50c14165b364333
BLAKE2b-256 56b2721ca3f6749b6027fd947a84b2682da96d5ba8f6679b08239165f65fe746

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e776d265a8ef54142c9a657cdcbd801ac69cbcdc62293acebc7c10947b9c4042
MD5 532e9a04b5bf6e3899c5c93a6ee8a62f
BLAKE2b-256 c0fd3789dd75e35f43434e048c643666282188a5cd0a66e9fe244a539af7fffb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 664b801d86d4a3586502b6845d83017b6f3497afba74656284d9cb3119433855
MD5 ea6d74828374f4b7fbc120d63a974a05
BLAKE2b-256 cd4afa00fd3c14e99ce937b68218bdd2268c222622dd98b02bad384b785231a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 3870a11db123bd15d733f5444ea930826b161d1a7028d89ff54f685310843345
MD5 eccaa27f1165d9a0518fab5eb57d0ac5
BLAKE2b-256 3f9875e6dbbee20129d7b19973b77b220fdd587f48d7db67c975d2e0260a96cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dbbcfd2705af185534b90bf465cf8731ad1f5a3ccbf03fe50c2fcd5cf7bd1637
MD5 ed9ba32680c2772fbba93cf7a1a5ddae
BLAKE2b-256 ad0f86576af243d365e727cda8d4d99fc15698ae052f7542bf8549c104a3eb91

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 400fbce60a4c03f9562ba4a842ff24889c8940584c69def79396e64d161b1fd6
MD5 46dd857b47d2630701fc12b474ad6d40
BLAKE2b-256 5949fa54a27917b8a2fd994264a9ccc42f54845004a8c988d2494b67afcc8009

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.3.6-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 af185f90a6a3c2ec717823366ee348a50f2271af2fc9144a52697cf7d4d1beba
MD5 23d89fe21c4760429722efd4d07d1c98
BLAKE2b-256 4a4c1276c4b582cfe445a221236053f8951139ab16688763727920ffc0945489

See more details on using hashes here.

Provenance

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