Skip to main content

Persistent JSON message queues for Python - native bindings for local and remote IPC

Project description

Plasmite Python Bindings (v0)

These bindings wrap the libplasmite C ABI via ctypes.

Installation

Wheels are designed to bundle native assets under plasmite/_native/:

  • libplasmite.(dylib|so) for ctypes loading
  • plasmite CLI binary (invoked via Python console script entrypoint)

Using uv (recommended)

uv tool install plasmite

For project dependencies in a uv-managed workspace:

uv add plasmite

Runtime load order is:

  1. PLASMITE_LIB_DIR override (development escape hatch)
  2. Bundled plasmite/_native/libplasmite.(dylib|so) absolute path
  3. System linker fallback (plasmite / libplasmite)

For development/testing from this repo, see Install & Test below.

Build Requirements

  • Python 3.10+
  • libplasmite built from this repo (cargo build -p plasmite) for local development

Install & Test

From the repo root:

cargo build -p plasmite

Canonical repo-root command:

just bindings-python-test

Equivalent manual commands (from bindings/python):

uv venv
source .venv/bin/activate
PLASMITE_LIB_DIR="$(pwd)/../../target/debug" uv pip install -e .
PLASMITE_LIB_DIR="$(pwd)/../../target/debug" PLASMITE_BIN="$(pwd)/../../target/debug/plasmite" python3 -m unittest discover -s tests

Build a wheel with bundled native assets from a specific SDK directory:

PLASMITE_SDK_DIR=/path/to/sdk python -m build

Usage

from plasmite import Client, Durability

with Client("./data") as client:
    with client.create_pool("docs", 64 * 1024 * 1024) as pool:
        message = pool.append_json(
            b'{"kind":"note","text":"hi"}',
            ["note"],
            Durability.FAST,
        )
        print(message.decode("utf-8"))

        frame = pool.get_lite3(1)
        print(len(frame.payload))

        for item in pool.tail(tags=["note"], max_messages=1, timeout_ms=100):
            print(item.decode("utf-8"))

Pool.tail(..., tags=[...]) uses exact tag matching and composes with other filters using AND semantics.

Error behavior

  • Invalid local arguments raise ValueError / TypeError.
  • ABI/runtime failures raise PlasmiteError with kind, path, seq, and offset when present.

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

plasmite-0.1.14.tar.gz (12.4 kB view details)

Uploaded Source

Built Distributions

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

plasmite-0.1.14-cp311-cp311-macosx_11_0_universal2.whl (5.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ universal2 (ARM64, x86-64)

plasmite-0.1.14-cp311-cp311-macosx_10_12_universal2.whl (5.6 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)

File details

Details for the file plasmite-0.1.14.tar.gz.

File metadata

  • Download URL: plasmite-0.1.14.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plasmite-0.1.14.tar.gz
Algorithm Hash digest
SHA256 552f6222cae5c1c57ed399c1fac9906d37966a564f3ca7c23af44707fe384a4c
MD5 f6fbb45c0ccf2e49603b5bf33244ccae
BLAKE2b-256 4a87025a2235f9bdf53760ce2a3dd6751d657ef83616ee000ef8baade01ef211

See more details on using hashes here.

File details

Details for the file plasmite-0.1.14-cp311-cp311-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for plasmite-0.1.14-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 a9c11ec3aacb6cb73761b65006a6866ed3b9789e8e78233cf989e5134d3606f2
MD5 2abd6e07933f46f2e8f384b59de16ffb
BLAKE2b-256 271f679f0b57f9f87663de21354a0b589ab546478dfcc6ffeab9f04d17670348

See more details on using hashes here.

File details

Details for the file plasmite-0.1.14-cp311-cp311-macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for plasmite-0.1.14-cp311-cp311-macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 00b5520eba4ea8932c283c576ca0fde67beddda828a5ec387b2b2cb1723c341e
MD5 1b10c6d6ed63dbd6aa0afdcc48fb2478
BLAKE2b-256 d04ff44255f7a5a5200caaae095a6a75ea19513eacf02ed8d8601b4cece9eca4

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