Skip to main content

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.

CI Coverage Tests Docs PyPI License: MIT Python

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 .env files (guide)
  • CLI for free--dry-run, --version, --log-level, --env-file via Typer (reference)
  • Test-friendlyMockMqttClient, 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


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.2.1.tar.gz (70.0 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.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl (576.2 kB view details)

Uploaded PyPymusllinux: musl 1.2+ x86-64

cosalette-0.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl (543.1 kB view details)

Uploaded PyPymusllinux: musl 1.2+ ARM64

cosalette-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl (574.6 kB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

cosalette-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl (540.6 kB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

cosalette-0.2.1-cp314-abi3-win_amd64.whl (225.6 kB view details)

Uploaded CPython 3.14+Windows x86-64

cosalette-0.2.1-cp314-abi3-musllinux_1_2_x86_64.whl (574.8 kB view details)

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

cosalette-0.2.1-cp314-abi3-musllinux_1_2_aarch64.whl (541.2 kB view details)

Uploaded CPython 3.14+musllinux: musl 1.2+ ARM64

cosalette-0.2.1-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (373.6 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARMv7l

cosalette-0.2.1-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (364.9 kB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ ARM64

cosalette-0.2.1-cp314-abi3-macosx_11_0_arm64.whl (333.2 kB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

cosalette-0.2.1-cp314-abi3-macosx_10_12_x86_64.whl (337.5 kB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

cosalette-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (371.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: cosalette-0.2.1.tar.gz
  • Upload date:
  • Size: 70.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cosalette-0.2.1.tar.gz
Algorithm Hash digest
SHA256 27762a29f9a3c0fd7e98dbda5754d350f2219d5cd651a7544702cc91330f4635
MD5 cfb47e9895ba380d43f1a78a07b4a2ac
BLAKE2b-256 30cfe65120aa13562719bbd4c32f7c29a19543909d5c0c88b7a7e09ec023fa25

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.2.1.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.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cf5dd74a5ad45d4bbeae8bbfeee7000f016622b31cd87c1ea66690ad79a8af03
MD5 9eb859a18d8ef7deb5d34e667394887c
BLAKE2b-256 f4f3fdd6c06234063db644d9b05442c8e94f998502000c623f51e141001fa660

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.2.1-pp311-pypy311_pp73-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.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cosalette-0.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2f000b97061239ca48627d80eefaae17a1598f68eb686e6b4c06de7f6f366aa5
MD5 8d0c60595f8158cabe3d3adf4db2a70b
BLAKE2b-256 3eaef6e5c70e70c445998a8378e5d9baf5e9b57672d56589a990dfc2d7e38725

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.2.1-pp311-pypy311_pp73-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.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fd619ffd6fc0fcd11d405b93bb53f7a9a411d9d848b49e64bfbaadd31e9c22d6
MD5 87c0ffe34a7fe6b260919d3bd0e8e43f
BLAKE2b-256 12388db724c1efcde1407008f3368a472896ff3f2272d4dca76bc36d762d5fab

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosalette-0.2.1-cp314-cp314t-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.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 21ef079840d0420c68d85580781604afb4ff84712de5815d8ec5371f31f3a647
MD5 436ea1efcef820a72057a3af6e89c89c
BLAKE2b-256 cb701819103a8cd7369c1d9a28ee12ca5f56af41af4e72308f0a241dd52556d0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cosalette-0.2.1-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 225.6 kB
  • Tags: CPython 3.14+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fd8f1e095cec52477ea41c2e512c468f159b2fe24a46cb43bf38a6ca645be500
MD5 0879fb3508282cc8c7a3986ac936cdfd
BLAKE2b-256 c77e07682214d7a560393266498625e47634ea7964782832116cc2945a63ff4f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7157f3299c94410b3d2f33a5ada8b378b6293a7ddefa690a3ed51dfc38954ecd
MD5 f46ee38c35788c188528c319b3807a1f
BLAKE2b-256 db8c9f87c561325fc81a1dbef78228f16d2d77c772f5b7983eb0a5ae8d5f54a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6864fd634bc5f1613b53bf942a46018fe2e6486c3e4ded2c1a6f0b9f96aadfe5
MD5 8af0b824c460c2c3d8cb7ff23843ef1e
BLAKE2b-256 05b2e0585d0e080d6847e2af309f315c326f1f2d33f9458099d5f0ce620e9f35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 44b0628210d9f8e551b8496eb7bbf5cb352270e4645850d4050ed331bc607d80
MD5 136f034afe34ca4bca121b7ca4d0f489
BLAKE2b-256 27be3636bb23018e92aaac70517831361f79181f4c8788e79560ef741469957a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d8a49f350e78511cc17c5ad778ad9a19cd52226cbfdb95475e4292daa21a5c23
MD5 3085f88f161d0f8739341bb02be56e10
BLAKE2b-256 63af4624d7b0eb1195cd949aee8e87e6b2bf03f903444c512a7a46e865f0cf94

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eabaab99366481527a325f7e0a3d75fe2138bd7acaa3eefb32eb491fbea8f530
MD5 5018285cefd74eccf39502f8a1b93d43
BLAKE2b-256 c4b9c879427c431ae44918552e4c7061a25e2a4a11b65ddd1c3d2647da3e5618

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cosalette-0.2.1-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4de860c9dbea8ec55908bf1a1b254f6a4d236441ed0b3fcb4eb66d25857db4d2
MD5 9427403db650396d4f52c758fb8d6cf0
BLAKE2b-256 b61ba9fab1adb0bab5ab001079ea229bf5d88f69f4e60509ba94cddb66fde30d

See more details on using hashes here.

Provenance

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

File details

Details for the file cosalette-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cosalette-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 308edbc4b8c4a53127bc9ab1fe2d77e45f9da751cdae100c75277e9e4ae032b2
MD5 3f4e3b0d926cae841437e0e84a208e04
BLAKE2b-256 4d3988d1de7f1f4c4db75e6bc6842cc80a1d1b3981332722d97ebc1d8c3f28a4

See more details on using hashes here.

Provenance

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

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