Skip to main content

Lightweight, efficient and developer-friendly framework for component communication

Project description

drawing

FastCC

Ruff Mypy Gitmoji

Framework for component communication with MQTT and Protocol Buffers :boom:.

  • Lightweight :zap:
  • Efficient :rocket:
  • Developer-friendly :technologist:

This framework is built on top of empicano's aiomqtt.

Example

import asyncio
import contextlib
import logging
import os
import sys
import typing

import fastcc

router = fastcc.Router()


@router.route("example")
async def example(name: str, *, database: dict[str, typing.Any]) -> str:
    database[name] = 1
    print(database)
    return f"Hello, {name}!"


async def main() -> None:
    logging.basicConfig(level=logging.INFO)

    database: dict[str, typing.Any] = {}
    mqtt_client = fastcc.Client("test.mosquitto.org")
    app = fastcc.FastCC(mqtt_client)
    app.add_router(router)
    app.add_injector(database=database)

    async with mqtt_client:
        await app.run()


# https://github.com/empicano/aiomqtt?tab=readme-ov-file#note-for-windows-users
if sys.platform.lower() == "win32" or os.name.lower() == "nt":
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

with contextlib.suppress(KeyboardInterrupt):
    asyncio.run(main())

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

fastcc-2.0.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastcc-2.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file fastcc-2.0.0.tar.gz.

File metadata

  • Download URL: fastcc-2.0.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for fastcc-2.0.0.tar.gz
Algorithm Hash digest
SHA256 04fef6161329f6d59697f95452be82a91ed8a6e84c97796abb8a3b9af1b60052
MD5 70e7ed646fcb06c177631c7c75b6867f
BLAKE2b-256 6c550758bcfe1e1f58618f4057d63292c403fb60e417f6558d7dce1b1eec6c56

See more details on using hashes here.

File details

Details for the file fastcc-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: fastcc-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for fastcc-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 412e87fc96d234da79e60bfb5685a9333a6bcdf2254ce9520214cf8216bc73f0
MD5 7a234cda8ee81a58f948b56448ae01a7
BLAKE2b-256 b120ca6972bd2921b1f514a75dd624914fe33d0a30452b2d6fec726f47c933e0

See more details on using hashes here.

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