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.6.tar.gz (26.7 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.6-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

pamoja_core-0.1.6-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.6-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.6-cp310-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

pamoja_core-0.1.6-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.6.tar.gz.

File metadata

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

File hashes

Hashes for pamoja_core-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f2cc5dd08db627f64d6fb510b5a1966b84fc0e2565d64646fc2cb9a2b0ece258
MD5 39981afaea7360f863bfe2a6e9dadb48
BLAKE2b-256 719f7762c695d8bcf6955fadd6483af7b6a6e1b99ddf7dd073adcbc39303bdc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fa2cf35b7fe07976caa01bf5a500762c78905e82d229464809b037c3a1ad984d
MD5 07e2681819c7ec73b430bd82caababa7
BLAKE2b-256 a6b6cc276c261c998660e70aedc9e9a4db366aa18f5d596b7a719abccf84b45e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54a957a09fa5b1848832fe6f94075fd69d1dd6fc4c81fc152e2efecb64be8891
MD5 68b59c897466dbda7593568e98d86c49
BLAKE2b-256 1b5bfffc0f6dd8d8e2f83c9672d83eb4de650b80ce9bb5d4b82e6669414be94c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a71ad760caeb6fa10298110d46afd27ec26a4d21fff2989ef13dffa8d31364e6
MD5 30d965291d2ad14702deb5419bbf0e6e
BLAKE2b-256 6a73fb5f42d64932ab2fcb2903c443d25ab93549e4218c5a2da4c7b8b8301e3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74fd79f8be162ab80b45bc2100bcaf1923019bfaad33744a1b46a0408f85ee2d
MD5 9dc64b7b65d79b1c4232ab0e1a2d626a
BLAKE2b-256 98d772e7f54c59b73874562c413d04ad08a5d261e628f5cf2b0f78c7c2fda3bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.6-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7a95f6ff64d0b714c8825f0eda60d69979342002edf541f1ab300db87b050c16
MD5 df1bd47fcdafed24cd153c64b74ea7b3
BLAKE2b-256 e11fc36222b07f1824c11999ec1377b6d13dabf44cc128a571219ede4618bb61

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