Skip to main content

Python bindings for the pamoja device SDK core.

Project description

pamoja-core (Python)

Python bindings for the pamoja device SDK core, built with PyO3 and maturin.

The generated surface is intentionally thin. A hand-written, idiomatic layer is added on top of it so Python callers get a native-feeling async API - awaitable methods, async for over incoming messages, async with lifecycle, and exceptions for errors - while all behavior stays in the Rust core.

The generated low-level contract remains available at pamoja.raw.

Install

pip install pamoja-core

Build from source

python -m venv .venv
.venv/bin/pip install maturin pytest
.venv/bin/maturin develop
.venv/bin/python -m pytest

maturin develop compiles the Rust core into a native extension (pamoja._core) and installs the pamoja package into the active environment.

cargo run --bin stub_gen regenerates the committed type stub python/pamoja/_core.pyi. It is a generated artifact, drift-checked in CI so it can never fall behind the Rust source.

Usage

import asyncio
from pamoja import MqttClient

async def main():
    async with MqttClient(client_id="sensor-1", host="localhost", port=1883) as client:
        await client.subscribe("sensors/+/temperature")
        await client.publish("sensors/1/temperature", "21.5")
        async for message in client:
            print(message.topic, message.payload.decode())

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

pamoja_core-0.1.5.tar.gz (26.5 kB view details)

Uploaded Source

Built Distributions

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

pamoja_core-0.1.5-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

pamoja_core-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

pamoja_core-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

pamoja_core-0.1.5-cp310-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

pamoja_core-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file pamoja_core-0.1.5.tar.gz.

File metadata

  • Download URL: pamoja_core-0.1.5.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.0

File hashes

Hashes for pamoja_core-0.1.5.tar.gz
Algorithm Hash digest
SHA256 10803042012552559921904a4b0dbe05bc2de280b063a58954b2fa9d883e2407
MD5 0b830dc18e0db423e54d8ee700a8533e
BLAKE2b-256 f8e127cbcccfc8e91f79f878991bfb9efc981aca537009cedf183097788bf481

See more details on using hashes here.

File details

Details for the file pamoja_core-0.1.5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pamoja_core-0.1.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0a3a726caff709a2f91d46b01c6a24bbe0a142f087d4da77b30f98667790ae5e
MD5 cda9533388ce29472d585765f25076e2
BLAKE2b-256 e6737ff97b0ad00f90683d9e391ba9b4c647c78fec70f5bc80d89c32589ee11f

See more details on using hashes here.

File details

Details for the file pamoja_core-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pamoja_core-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44891812a3b24c96d9aadc867c24c8d44acf6b46e08e9100f0fd175e6f35a954
MD5 f9900c35c9cb5037e3f00ab4218fe914
BLAKE2b-256 40e682c442822686f69c0cdfbb5b64fe3abf0ea51d019aa8a3d3ad2e07bc8009

See more details on using hashes here.

File details

Details for the file pamoja_core-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pamoja_core-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 47a2219262663c1b2416d6cc0741319e15af768a01b1729987e2e77ad25d8875
MD5 4bb485db6d137f62029fa2c132a75b14
BLAKE2b-256 3e8e17f347359162c38a6255a9726a7955fec77b6e4b541356a3bb3ae3ae44d5

See more details on using hashes here.

File details

Details for the file pamoja_core-0.1.5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pamoja_core-0.1.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 141d1758f3efc5ed38fbe4233bbdc6221cc9debe95ec17cb5dadc54e6b3b2d83
MD5 c93368dd37deb9abea940ca96943397e
BLAKE2b-256 1b6c9e4a56b4d44109aedb8c9b83f0b68a560ce9af2c14815398cb61a72c4fa9

See more details on using hashes here.

File details

Details for the file pamoja_core-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pamoja_core-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 43ac96fd5097a78c0344beb11be62ea7e135af08b5aeb6a17ed48137eebd2d5b
MD5 2f301b1f8914957eb887bd02075945ce
BLAKE2b-256 d2c3055e16f1f33c7725ad12f6a9f383a8c4368b663c5c7b95f78cd0e385ad72

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