Skip to main content

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.

Router Composition (Multi-Module Apps)

For production apps, use Router to organize devices into separate modules without circular imports:

# sensors.py
import cosalette

router = cosalette.Router(prefix="sensors")


@router.telemetry("temperature", interval=30)
async def read_temp() -> dict[str, object]:
    return {"celsius": 22.5}


# main.py
import cosalette
from sensors import router

app = cosalette.App(name="home2mqtt", version="1.0.0")
app.include_router(router)
# → publishes to: home2mqtt/sensors/temperature/state

See Router Composition for full patterns.

Typed Contracts & Schema Inspection

cosalette supports Pydantic-validated payloads and typed returns for type-safe command handlers and telemetry, plus dependency injection for shared logic:

from typing import Annotated
from pydantic import BaseModel
import cosalette

app = cosalette.App(name="thermo2mqtt", version="1.0.0")


class SetpointCommand(BaseModel):
    value: float
    unit: str = "celsius"


class ThermostatState(BaseModel):
    setpoint: float
    unit: str


def get_device_id() -> str:
    return "thermo-001"


@app.command("thermostat/set")
async def set_temp(
    cmd: Annotated[SetpointCommand, cosalette.Payload()],
    device_id: Annotated[str, cosalette.Depends(get_device_id)],
) -> ThermostatState:
    return ThermostatState(setpoint=cmd.value, unit=cmd.unit)

Inspect the contract to generate AsyncAPI docs or consumer artifacts:

cosalette manifest myapp.main:app           # JSON AsyncAPI 3.0.0
cosalette manifest myapp.main:app --table   # human-readable table

Or programmatically:

doc = app.asyncapi()  # returns dict conforming to AsyncAPI 3.0.0

See Contract-First Route Design and Schema Enforcement for full details.

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.

Metadata

Release files for cosalette 0.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cosalette 0.12.2
File Size Uploaded Provenance Actions
cosalette-0.12.2.tar.gz 852.4 kB With provenance Details for cosalette-0.12.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cosalette 0.12.2
File Actions
cosalette-0.12.2-cp314-abi3-win_amd64.whl CPython 3.14 abi3 Windows x86-64 Details for cosalette-0.12.2-cp314-abi3-win_amd64.whl
cosalette-0.12.2-cp314-abi3-musllinux_1_2_x86_64.whl CPython 3.14 abi3 Linux musl 1.2+ x86-64 Details for cosalette-0.12.2-cp314-abi3-musllinux_1_2_x86_64.whl
cosalette-0.12.2-cp314-abi3-musllinux_1_2_armv7l.whl CPython 3.14 abi3 Linux musl 1.2+ ARMv7l Details for cosalette-0.12.2-cp314-abi3-musllinux_1_2_armv7l.whl
cosalette-0.12.2-cp314-abi3-musllinux_1_2_aarch64.whl CPython 3.14 abi3 Linux musl 1.2+ ARM64 Details for cosalette-0.12.2-cp314-abi3-musllinux_1_2_aarch64.whl
cosalette-0.12.2-cp314-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.14 abi3 Linux glibc 2.17+ x86-64 Details for cosalette-0.12.2-cp314-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
cosalette-0.12.2-cp314-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl CPython 3.14 abi3 Linux glibc 2.17+ ARMv7l Details for cosalette-0.12.2-cp314-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
cosalette-0.12.2-cp314-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.14 abi3 Linux glibc 2.17+ ARM64 Details for cosalette-0.12.2-cp314-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
cosalette-0.12.2-cp314-abi3-macosx_11_0_arm64.whl CPython 3.14 abi3 macOS 11.0+ ARM64 Details for cosalette-0.12.2-cp314-abi3-macosx_11_0_arm64.whl
cosalette-0.12.2-cp314-abi3-macosx_10_12_x86_64.whl CPython 3.14 abi3 macOS 10.12+ x86-64 Details for cosalette-0.12.2-cp314-abi3-macosx_10_12_x86_64.whl

Total release size: 14.1 MB

Release files / cosalette-0.12.2.tar.gz

Download URL cosalette-0.12.2.tar.gz
Size 852.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f1df1cfb669df52e5ba6acf7e0d4831ac9d53b1ab2be121942bb3e7cb1ecb1b5
BLAKE2b-256 checksum
How to use checksums
7cf94adbddd69c14d6f09a62accca714806161c8ce63daabb875b62de0c7e25b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-win_amd64.whl

Download URL cosalette-0.12.2-cp314-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.14 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
fc4122dae40f9ede68ea390d06782185a2b7ad73908d24e448686bf0c5ea63bc
BLAKE2b-256 checksum
How to use checksums
21b26812865d97c9917eec37539a5a1fcdd21bcd3d222e697b4347e217f0e805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-musllinux_1_2_x86_64.whl

Download URL cosalette-0.12.2-cp314-abi3-musllinux_1_2_x86_64.whl
Size 1.7 MB
Tags CPython 3.14 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
a5d729c6667b06a8e4f319e3b400a78397f590440ad1a4e87edcc664e83c8330
BLAKE2b-256 checksum
How to use checksums
b9b1fd34e6c5455dc8368674fd618e2bbd19e4e383e03f6300128d07c60f670c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-musllinux_1_2_armv7l.whl

Download URL cosalette-0.12.2-cp314-abi3-musllinux_1_2_armv7l.whl
Size 1.7 MB
Tags CPython 3.14 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
5b89517eacc9caaef14cafbfce454bb68502dbe0eb6ea562c99b84419e61d3b9
BLAKE2b-256 checksum
How to use checksums
fe5d0c43d97f8c1e9f83b84c0b8041f687512fa9ba008f5c63104da1adefa41f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-musllinux_1_2_aarch64.whl

Download URL cosalette-0.12.2-cp314-abi3-musllinux_1_2_aarch64.whl
Size 1.6 MB
Tags CPython 3.14 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
74860c8cce9c7a999a297585cf1ba83e5d45615e78299260b1c6242e8ddcc336
BLAKE2b-256 checksum
How to use checksums
f5eeee00bc45fbe88b72bf1dc10faa9d47595b704d5986c88af669af5039a6bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL cosalette-0.12.2-cp314-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
67bbd16f296ca2d90062cb10c9cfe5ea5d173ea31adb50bcb20e1c11c8644c7c
BLAKE2b-256 checksum
How to use checksums
5a0f7ef14a83c6ecad48eb8f999eecfa041feb166dcc7ccdaae7be9c9a7779e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl

Download URL cosalette-0.12.2-cp314-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
Size 1.4 MB
Tags CPython 3.14 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
605ce33aad04d3a2d134973f65d1f2cd8d6561b26b28dd6699cd558d04ed4227
BLAKE2b-256 checksum
How to use checksums
cec444bd50a0767c7b70704817bdddba94ff0ff5bfdb34c837067451e8294fe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL cosalette-0.12.2-cp314-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.14 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1519424dae1e523e4f242af6bec26acb6970a9eb7a5573794b54f90f415916f5
BLAKE2b-256 checksum
How to use checksums
60ed8f2773b8fd1523e3d13a2118675fe65d1e9f492b3d950da30675b0282e4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-macosx_11_0_arm64.whl

Download URL cosalette-0.12.2-cp314-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.14 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0910870c776a9366c00770187b63242a42a41f0c7534535e321c56bbf2fb3c56
BLAKE2b-256 checksum
How to use checksums
eddaf01ad32158de754c646973a40bb2e7248a9538d96bcbb23bc5cc95ae54f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / cosalette-0.12.2-cp314-abi3-macosx_10_12_x86_64.whl

Download URL cosalette-0.12.2-cp314-abi3-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e398220ae39187d6dce55332354d70246932cbdd5d3e4e506fe8bcba6e08499a
BLAKE2b-256 checksum
How to use checksums
ae38d14d7c48bad78edeff15b7dbcfded1575ead0670908c968f28e078b50572
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for cosalette 0.12.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 10 files in this release have been uploaded with provenance metadata.

Select from 10 files

Attestation for cosalette-0.12.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12.2 This release

10 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page