an opinionated Python framework for building IoT-to-MQTT bridge applications
Project description
cosalette
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cosalette-0.3.4.tar.gz.
File metadata
- Download URL: cosalette-0.3.4.tar.gz
- Upload date:
- Size: 237.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d39b4a628141b3ca27e6ef810d9be5c35ab36be0cfa25a3bf2d747e148519eec
|
|
| MD5 |
ef980f3006071db0c7ef767221b5de13
|
|
| BLAKE2b-256 |
f5d2e7e74a4ebcdfe2286aa2dc00b208a602231e34e51b46b2c4648625270016
|
Provenance
The following attestation bundles were made for cosalette-0.3.4.tar.gz:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4.tar.gz -
Subject digest:
d39b4a628141b3ca27e6ef810d9be5c35ab36be0cfa25a3bf2d747e148519eec - Sigstore transparency entry: 1342353718
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-win_amd64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-win_amd64.whl
- Upload date:
- Size: 408.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80ad74435c3d78fef424e01eb56fc667581aa5b675f9c6e098eeb56a5d17338
|
|
| MD5 |
a9ebd6c250737f7e7ecd9e573d940d2c
|
|
| BLAKE2b-256 |
431d1668c90fcd609f5860bc69adf7ee57f6105942b68df224bb702602ad667b
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-win_amd64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-win_amd64.whl -
Subject digest:
a80ad74435c3d78fef424e01eb56fc667581aa5b675f9c6e098eeb56a5d17338 - Sigstore transparency entry: 1342353841
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 752.6 kB
- Tags: CPython 3.14+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1dda99406d74a60990838042e16e211b587fc10a960d8f753abd3435cdef58e
|
|
| MD5 |
1ea64be3173a52a05b96001e7d281eba
|
|
| BLAKE2b-256 |
068d535c397359cb887b809761eec2e03419a8c2af86575bf2416aefd727c3b5
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-musllinux_1_2_x86_64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-musllinux_1_2_x86_64.whl -
Subject digest:
f1dda99406d74a60990838042e16e211b587fc10a960d8f753abd3435cdef58e - Sigstore transparency entry: 1342354171
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 721.7 kB
- Tags: CPython 3.14+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc0e4bc586c55ac4e33656c2e4b209d9eaf19c49a4927e2fc98fd74c037d3511
|
|
| MD5 |
e2c5632e0c0b96bc07e6972fc795480c
|
|
| BLAKE2b-256 |
e056d96d4c1de2614537e1a8b56d2809bb6ee319aff0baa1b4bead8a4b0b5d1a
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-musllinux_1_2_aarch64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-musllinux_1_2_aarch64.whl -
Subject digest:
dc0e4bc586c55ac4e33656c2e4b209d9eaf19c49a4927e2fc98fd74c037d3511 - Sigstore transparency entry: 1342354121
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 549.9 kB
- Tags: CPython 3.14+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364807949c5cf3b7c9955ce6bb3749c6f014a504725c6cb8bd795b913614eb5b
|
|
| MD5 |
cf5d222f1588a2ac02b9d7ac02234574
|
|
| BLAKE2b-256 |
2e1aca9f9befb07f3d5dd3d2ecb32830f5918da7e471573554471006fddd9c17
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
364807949c5cf3b7c9955ce6bb3749c6f014a504725c6cb8bd795b913614eb5b - Sigstore transparency entry: 1342354068
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 553.3 kB
- Tags: CPython 3.14+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c35e59cb955f8436b6cd5acfab4b95cca8e1e2661fc97bb85d4c0800158f97b
|
|
| MD5 |
75e8ea1737ce70f31af072d53639f6fe
|
|
| BLAKE2b-256 |
697b76664c9ffbc3dda66fbb818483a7db65a14e1218a60b32f92e21d448b92a
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl -
Subject digest:
4c35e59cb955f8436b6cd5acfab4b95cca8e1e2661fc97bb85d4c0800158f97b - Sigstore transparency entry: 1342353956
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 546.0 kB
- Tags: CPython 3.14+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
803fab364b9690016d365bb0298548e93552e98142981efcb70b12292146171e
|
|
| MD5 |
dc1292190dcb93f5c3429abbeb7c8385
|
|
| BLAKE2b-256 |
aba2e03a714b73b106024f79a733147aa1b73adebb53b6701ffdc309484ee0e3
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
803fab364b9690016d365bb0298548e93552e98142981efcb70b12292146171e - Sigstore transparency entry: 1342353906
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 514.6 kB
- Tags: CPython 3.14+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35b9d285e35d0bcca951e3a042d7cfd6350431bd9e61839e0cbfbcef6c8bedc7
|
|
| MD5 |
9c19545dbce8d40720bab11d2916e320
|
|
| BLAKE2b-256 |
404d85c6f97b4a3c6a6b4edb51c33dea35c5bb1e00158b71df0a71de1fb8d205
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-macosx_11_0_arm64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-macosx_11_0_arm64.whl -
Subject digest:
35b9d285e35d0bcca951e3a042d7cfd6350431bd9e61839e0cbfbcef6c8bedc7 - Sigstore transparency entry: 1342354027
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.3.4-cp314-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: cosalette-0.3.4-cp314-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 519.3 kB
- Tags: CPython 3.14+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70dbc4a97f204ce73931184fe7eb3b000ad78772d8aeba19228429fa4f1813cb
|
|
| MD5 |
0e64b7bc5914e4f80550cd6fcf34072c
|
|
| BLAKE2b-256 |
b276048118f5a53f5e7e54857a6439c7c793afe76388e451345ea1085fc5f56e
|
Provenance
The following attestation bundles were made for cosalette-0.3.4-cp314-abi3-macosx_10_12_x86_64.whl:
Publisher:
release-please.yml on ff-fab/cosalette
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosalette-0.3.4-cp314-abi3-macosx_10_12_x86_64.whl -
Subject digest:
70dbc4a97f204ce73931184fe7eb3b000ad78772d8aeba19228429fa4f1813cb - Sigstore transparency entry: 1342353782
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ff-fab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@f8a8d9721cee1cf0876fba05bb8f4c526a847662 -
Trigger Event:
push
-
Statement type: