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.3.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.3-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

pamoja_core-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: pamoja_core-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 9f0f4b103d9d364b4c0c5c22de495dc08f39464ef408058c95163c7d7a27c7fa
MD5 e6cce6e92aa9d20de3d4a47e504618b3
BLAKE2b-256 5b5c80aba2b903631b36d8a5deabd5e2fdb25a709830dac05a9e92b51b93ccdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 98be59d0df448ca88487de35e401b380b76bca34fb86accf11d3ae734f7bdfd7
MD5 0794cca3cb4370f958c071eeacaee8aa
BLAKE2b-256 5e3527851120e12ba4506ebee5b286bbdcbf88b59c98a24f7b99d9abe9832746

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 665d1fd595381c4f96c42c0780466223fddc22bcc2f3bc16beef55e183386acf
MD5 29294ccfe228482c7f1ba4663bafeeff
BLAKE2b-256 2ece70499f3f2962bbd43e7f31d4f4a216faec92fac9d984ce8d3d192b8b63ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ff08726ca9d75842720f11b5475decdbe9a60332223a208a9bd96e4f345e1911
MD5 03b2e1c3023863c2edce91db05ff1947
BLAKE2b-256 e7c7ff665cdfda96d59cba8bb63b1e0773415151e2f4e49bf249b5f20427b732

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cd6b423327925d96b144fdf598cf793e4c6da18bf2c75b9956447b395c5b3b8
MD5 2f233fcee9dbfa597dbc61781ff99913
BLAKE2b-256 1780869844aea9a350add2ec6c19aafcbb5e3ab0d3f4b4c6679225d3cf8d695a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pamoja_core-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b25133b82f9135dee01cfa4120dda2ef47bc2561ab683a043cc293a08bbad36b
MD5 7791e4d45c79bb1ffaa8ef33f9e98150
BLAKE2b-256 0a5268bca0dc3f62bf828bf8e73c63dcc8af6e787a07fa02300598a9bf78cc08

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