an opinionated Python framework for building IoT-to-MQTT bridge applications
Project description
cosalette
An opinionated Python framework for building IoT-to-MQTT bridge applications.
Documentation · Quickstart · API Reference
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.
Key Features
- Declarative device registration —
@app.command(),@app.device(), and@app.telemetry()decorators (guide) - Hexagonal architecture — protocol-based ports with swappable adapters (concept)
- Structured JSON logging — per-device context, configurable levels (concept)
- Health & heartbeats — LWT crash detection, periodic JSON heartbeats, per-device availability (concept)
- Structured error publishing — domain errors published to MQTT with type mapping (concept)
- Pydantic settings — type-safe configuration from env vars and
.envfiles (guide) - CLI for free —
--dry-run,--version,--log-level,--env-filevia Typer (reference) - Test-friendly —
MockMqttClient,FakeClock, pytest fixtures included (guide)
Quick Example
import cosalette
app = cosalette.App(name="weather2mqtt", 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.
Installation
pip install cosalette
Or with uv:
uv add cosalette
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.
| Section | What you'll find |
|---|---|
| Getting Started | Installation, quickstart tutorial |
| Concepts | Architecture, MQTT topics, lifecycle, hexagonal design |
| How-To Guides | Step-by-step guides for each feature |
| 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 Distribution
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.1.1.tar.gz.
File metadata
- Download URL: cosalette-0.1.1.tar.gz
- Upload date:
- Size: 302.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b2a5ac1205ae4e9cd16814f53bf75f5d04b3ba91c267e55f70618b6e950ac0b
|
|
| MD5 |
457787d7f438a674a6092faa74241735
|
|
| BLAKE2b-256 |
962e1e8527b6d88741b5332b52f7a71b821a9653169db0763e57725e3f6b52c6
|
Provenance
The following attestation bundles were made for cosalette-0.1.1.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.1.1.tar.gz -
Subject digest:
0b2a5ac1205ae4e9cd16814f53bf75f5d04b3ba91c267e55f70618b6e950ac0b - Sigstore transparency entry: 976340804
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@270d4ea24ce1b1e09a352352358469c2a8cbae6e -
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@270d4ea24ce1b1e09a352352358469c2a8cbae6e -
Trigger Event:
push
-
Statement type:
File details
Details for the file cosalette-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cosalette-0.1.1-py3-none-any.whl
- Upload date:
- Size: 43.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a6686052733cf5b2fbb57faecf64c615339f405c3a2cabe46177fbadd2203e0
|
|
| MD5 |
ca1aa61369436686adceca0f5166123a
|
|
| BLAKE2b-256 |
95ef8020294cffee30ccb0c63d4aac5b0a0d5c45953d1e776d7a1c3cc2213f52
|
Provenance
The following attestation bundles were made for cosalette-0.1.1-py3-none-any.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.1.1-py3-none-any.whl -
Subject digest:
2a6686052733cf5b2fbb57faecf64c615339f405c3a2cabe46177fbadd2203e0 - Sigstore transparency entry: 976340806
- Sigstore integration time:
-
Permalink:
ff-fab/cosalette@270d4ea24ce1b1e09a352352358469c2a8cbae6e -
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@270d4ea24ce1b1e09a352352358469c2a8cbae6e -
Trigger Event:
push
-
Statement type: